Can Somebody Tell Me Whats Wrong?

Joined
Oct 11, 2011
Messages
46
Reaction score
0
Points
6
Your Mac's Specs
13" MacBook Pro 2.4 GHz 8 GB Ram 250 GB HD, iPhone 4/S 64 GB, iPhone 3GS 16 GB, iPad 16 GB Wi-Fi
I'm working on a tableview/navigation on my tab bar app. and I've been following this tutorial trying to implement it on my app (Beginning Storyboards in iOS 5 Part 1 | Ray Wenderlich)



it gets a sigbart error from this coding:


Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    ImageStrings* theDataObject = [self theImageClass];
  
    theDataObject.prodTableArray = [NSMutableArray arrayWithCapacity:20];
    FourthSales *prodSales = [[FourthSales alloc] init];
    prodSales.prodCode = [NSString stringWithFormat:@"%@", [theDataObject.prodTableArray objectAtIndex:1 ]];
  
  

    // Override point for customization after application launch.
    return YES;
}

I've used the data sharing example also from duncan

Sharing data between view controllers and other objects - iPhone Dev SDK Forum (dead link removed)

it only bugs out when i add that coding, which i need it for my table view as it gets data from a web service by barcode scan.

can i have that in my view controller instead of the app delegate?
 
Joined
Feb 25, 2009
Messages
2,112
Reaction score
71
Points
48
Your Mac's Specs
Late 2013 rMBP, i7, 750m gpu, OSX versions 10.9.3, 10.10
If it's in the app delegate, it's easy to get it in the view controller - just get a handle to the app delegate and then request the ivar (assuming you have a property for your data ivar set up in the app delegate) - which means you'd move ImageStrings *theDataObject to be an IVar and setup a property for it

you would get it from something similar to...

Code:
YourAppDelegateName *appDelegate = (YourAppDelegateName *)[[UIApplication sharedApplication] delegate];

then you would get the data..

self.localRetainOfData = appDelegate.theDataObject;

then you would just access the data from the local ivar of the class.

Keep in mind, passing data between view controllers (direct passing, not accessing through the app delegate) requires use of the segue methods where you can set data values in the destination view controllers (this is going from view A to view B, not from app launch to view a)
 
OP
L
Joined
Oct 11, 2011
Messages
46
Reaction score
0
Points
6
Your Mac's Specs
13" MacBook Pro 2.4 GHz 8 GB Ram 250 GB HD, iPhone 4/S 64 GB, iPhone 3GS 16 GB, iPad 16 GB Wi-Fi
If it's in the app delegate, it's easy to get it in the view controller - just get a handle to the app delegate and then request the ivar (assuming you have a property for your data ivar set up in the app delegate) - which means you'd move ImageStrings *theDataObject to be an IVar and setup a property for it

you would get it from something similar to...

Code:
YourAppDelegateName *appDelegate = (YourAppDelegateName *)[[UIApplication sharedApplication] delegate];

then you would get the data..

self.localRetainOfData = appDelegate.theDataObject;

then you would just access the data from the local ivar of the class.

Keep in mind, passing data between view controllers (direct passing, not accessing through the app delegate) requires use of the segue methods where you can set data values in the destination view controllers (this is going from view A to view B, not from app launch to view a)


forgot to thank you for your help

thanks
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top