I want to create a NSArray like following :
NSArray * alphabets = [NSArray arrayWithObjects:'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',nil];
but I will get BAD_ACCESS_ERROR during execution of that.
how can I figure it out and make this line of code working?
regards
You can add to
NSArrayonly objects. For example,But
'a'is not an object. When you write@"a"compile creates object of typeNSStringand adds it to yourarray.