Discussion Forums  >  Introduce Yourself

Replies: 8    Views: 77

i am so rubbish
I hate code!
Profile
Posts: 10
Reg: Feb 15, 2013
hitchin
950
05/08/13 08:34 AM (12 years ago)

hi all

i am pretty new to this , only been learning about 4months..need a hand with a little XCODE problem is someone would love to help..pretty sure it could be easy for someone to solve..but i cant..thanks guys.. and girls..must be PC..
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
05/08/13 08:37 AM (12 years ago)
Hey sir! Xcode isn't going to drop on your PC, Mac only buddy. Is that your issue?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/08/13 08:45 AM (12 years ago)
What's your problem?
 
i am so rubbish
I hate code!
Profile
Posts: 10
Reg: Feb 15, 2013
hitchin
950
like
05/08/13 08:57 AM (12 years ago)
hahha , thanks Macapple , PC is a term for policitical correctness in the Uk..so im saying guys and girls... Chris if you could help that would be awesome.. I have passed an image from one VC to another but in the second VC it wont size to the size of the IPHONE..yet in the first VC the image resizes ok. Here is some codey stuff first VC m file ViewController *vc2 =[self.storyboard instantiateViewControllerWithIdentifier:@"Viewcontroller2"]; vc2.imagetopass = self.backgroundimage; ...this bit [self presentViewController:vc2 animated:NO completion:nil]; in second VC m file background = imagetopass; [self.view addSubview :background ]; [self.view sendSubviewToBack:background]; I have already setup background , property and synthesized and linked it to the second VC The image passes ok , but wont resize...any thoughts Ta x
 
i am so rubbish
I hate code!
Profile
Posts: 10
Reg: Feb 15, 2013
hitchin
950
like
05/08/13 09:01 AM (12 years ago)
hahha , thanks Macapple , PC is a term for policitical correctness in the Uk..so im saying guys and girls... Chris if you could help that would be awesome.. I have passed an image from one VC to another but in the second VC it wont size to the size of the IPHONE..yet in the first VC the image resizes ok. Here is some codey stuff first VC m file ViewController *vc2 =[self.storyboard instantiateViewControllerWithIdentifier:@"Viewcontroller2"]; vc2.imagetopass = self.backgroundimage; ...this bit [self presentViewController:vc2 animated:NO completion:nil]; in second VC m file background = imagetopass; [self.view addSubview :background ]; [self.view sendSubviewToBack:background]; I have already setup background , property and synthesized and linked it to the second VC The image passes ok , but wont resize...any thoughts Ta x
 
i am so rubbish
I hate code!
Profile
Posts: 10
Reg: Feb 15, 2013
hitchin
950
like
05/08/13 09:11 AM (12 years ago)
hahha , thanks Macapple , PC is a term for policitical correctness in the Uk..so im saying guys and girls... Chris if you could help that would be awesome.. I have passed an image from one VC to another but in the second VC it wont size to the size of the IPHONE..yet in the first VC the image resizes ok. Here is some codey stuff first VC m file ViewController *vc2 =[self.storyboard instantiateViewControllerWithIdentifier:@"Viewcontroller2"]; vc2.imagetopass = self.backgroundimage; ...this bit [self presentViewController:vc2 animated:NO completion:nil]; in second VC m file background = imagetopass; [self.view addSubview :background ]; [self.view sendSubviewToBack:background]; I have already setup background , property and synthesized and linked it to the second VC The image passes ok , but wont resize...any thoughts Ta x
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/08/13 09:12 AM (12 years ago)
Why not make the second vc a Buzztouch vc? Instead of subclassing viewController, subclass BT_viewController. Then, pass along screenData like so: first .m file: -(void)someMethod { BT_item *screenToLoad = [[BT_item alloc]init]; screenToLoad.itemId = @"someID"; screenToLoad.itemNickname = nil; screenToLoad.itemType = @"ClassNameOfSecondViewController"; NSMutableDictionary *theJSONvalues = [[NSMutableDictionary alloc]init]; [theJSONvalues setValue:@"someID" forKey:@"itemId"]; [theJSONvalues setValue:nil forKey:@"itemNickname"]; [theJSONvalues setValue:screenToLoad.itemType forKey:@"itemType"]; [theJSONvalues setValue:@"nameOfBackgroundImageWithExtension" forKey:@"backgroundImageNameSmallDevice"]; //add theJSONvalues to screenToLoad: screenToLoad.jsonVars = theJSONvalues; //load the second viewController [BT_viewControllerManager handleTapToLoadScreen:self.screenData theMenuItemData:nil theScreenData:screenToLoad]; [theJSONvalues release]; [screenToLoad release]; } ---------- In the second viewController .m file: -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [BT_debugger showIt:self theMessage:@"viewWillAppear"]; //flag this as the current screen YOURPROJECTNAMEHERE_appDelegate *appDelegate = (YOURPROJECTNAMEHERE_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; //setup navigation bar and background [BT_viewUtilities configureBackgroundAndNavBar:self theScreenData:[self screenData]]; }
 
i am so rubbish
I hate code!
Profile
Posts: 10
Reg: Feb 15, 2013
hitchin
950
like
05/08/13 09:25 AM (12 years ago)
wow , what an snswer , ok i will give that a go..although its frustrating that the image passes just cant get it to resize...thanks for this.:)
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
05/08/13 09:34 AM (12 years ago)
Nice one, Chris1 will take you where you need to go. Should have picked up in the PC comment since I'm a Scot. When I see Xcode and PC in same sentence.....
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.