Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-07-2010, 03:53 PM   #1 (permalink)
StefanL
Registered Member
 
Join Date: Jul 2009
Location: Wien/Austria
Posts: 242
Default Getting Variables from a NSMutableArray

Hi,

I am trying to get NSStrings from a NSMutableArray, but my app is crashing...

Here is my Code - the app is crashing on "branch = [....]; but the NSMutableArray is filled with (see test below)...

Code:
showData = [[NSMutableArray alloc]init];
	
	branch =[showData objectAtIndex:0];
	company = [showData objectAtIndex:1];
	name = [showData objectAtIndex:2];
	phone = [showData objectAtIndex:3];
	email = [showData objectAtIndex:4];
	price = [showData objectAtIndex:5];
	notes = [showData objectAtIndex:6];
	
	NSLog(@"The Branch: %@", company);
My NSMutable Array:

New Array: 12, 13, 14, 15, 16, 19, 18

Test: INSERT OR REPLACE INTO PARTNER (branche, company, name, phone, email, price, notes ) VALUES ('12', '13', '14', '15', '16', '19', '18');

Crashlog: New Array: 12, 13, 14, 15, 16, 19, 18
2010-02-07 21:28:00.956 WPlite[9034:207] *** -[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x3b77970
2010-02-07 21:28:00.957 WPlite[9034:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x3b77970'

May you please can point me to the right direction...

Thanks for any advice,

Stefan

Last edited by StefanL; 02-07-2010 at 03:56 PM.
StefanL is offline   Reply With Quote
 

» Advertisements
» Online Users: 809
25 members and 784 guests
acegames, ADY, aslyworo, ckgni, dabvid, dfvdan, GFish, GHuebner, ghz.rai, ilmman, iph_s, joeallenpro, john love, keeshux, marto1914, Ndpiparava, nfung, nru, Pandafox, RoryHarvey, tomtom100, VikMyr, waq963, _Mac
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,869
Threads: 89,225
Posts: 380,692
Top Poster: BrianSlick (7,129)
Welcome to our newest member, aslyworo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.