NSMutableArrayにNSStringがaddObjectできないときは、配列の生成ができていない可能性があります。
特に、アプリデリゲートとしてAppDelegate.mで宣言したときは忘れやすいので注意。
AppDelegate.m
特に、アプリデリゲートとしてAppDelegate.mで宣言したときは忘れやすいので注意。
AppDelegate.m
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize array;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
//配列を空で生成
array = [NSMutableArray array]; //⬅ここ
return YES;}
コメント