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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 06-24-2010, 10:08 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 129
stephen is on a distinguished road
Default Issue displaying in log file.

I'm getting an error with the following code below. Anyone any ideas ?


Code:

Code:
- (NSString *) str
{
	return str;
}



- (void) setStr:(NSString *)input
{
	[input retain];
	[str release];
	str = input;
}


for (i = 0; i < arrayItemQuantity; i++)
	{
		NSLog (@"Element %i = %@", i, [stories objectAtIndex: i]);
		//NSLog (@"Field Name: ", [[stories objectAtIndex:i] valueForKey:@"ID"]); 
		//NSLog (@"Field Name: ", [[stories objectAtIndex:i] valueForKey:@"walkID"]); 
		//NSLog (@"Field Name: ", [[stories objectAtIndex:i] valueForKey:@"Comments"]); 
		NSLog (@"Element %i contains fields: %d - %s - %d",i,[[stories objectAtIndex: i] getIntegerField],[[stories objectAtIndex: i] getStringField],[[stories objectAtIndex: i] getAnotherIntegerField]);

	}
stephen is offline   Reply With Quote
Old 06-24-2010, 10:49 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 129
stephen is on a distinguished road
Default

Problem solved:
Code:
-(void)createXMLFeed{
	//Fetch details from the database.
	NSFetchRequest *request = [[NSFetchRequest alloc] init];
	NSEntityDescription *entity = [NSEntityDescription entityForName:@"Tabrss" inManagedObjectContext:managedObjectContext];
	[request setEntity:entity];
	NSError *error;
	self.stories = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy];
	//[request release];
	
	// Count the number of items in the array and display in the log.
	int arrayItemQuantity = [stories count];
	NSLog(@"Array Quantity: %d", arrayItemQuantity);
	
	// Loop through the array and display the contents in the log.
	int i;
	for (i = 0; i < arrayItemQuantity; i++)
	{
		//NSString *xml = @"<xml><node>Hello World!</node></xml>";
		NSLog (@"Field Name: %@", [[stories objectAtIndex:i] valueForKey:@"ID"]); 
		NSLog (@"Field Name: %@", [[stories objectAtIndex:i] valueForKey:@"walkID"]); 
		NSLog (@"Field Name: %@", [[stories objectAtIndex:i] valueForKey:@"Comments"]); 
		NSLog (@"Field Name: %@", [[stories objectAtIndex:i] valueForKey:@"xDate"]); 
		NSLog (@"Field Name: %@", [[stories objectAtIndex:i] valueForKey:@"xTime"]); 
	}
	
	[stories release]; 
	
	// Update log file.
	NSLog(@"Database read and XML feed created.");
stephen is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 371
9 members and 362 guests
.Snipe, AragornSG, baja_yu, ChrisYates, davejas69, guusleijsten, hussain1982, Kryckter, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,645
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, leighec68
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:37 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0