Wrox Programmer Forums
|
BOOK: Professional iPhone and iPad Database Application Programming
This is the forum to discuss the Wrox book Professional iPhone and iPad Database Application Programming by Patrick Alessi; ISBN: 978-0-470-63617-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional iPhone and iPad Database Application Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2012, 06:41 PM
Registered User
 
Join Date: Dec 2011
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Default Sending NSString to another viewController

I want to set an NSString in the RootViewController then when the user goes to DetailView, i could pass that string with the new view.

RootViewController
---------------------
Code:
.h

    NSString *core;


@property (nonatomic, retain) NSString *core;


.m

DetailViewController *DetailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];

DetailViewController.core = core;

DetailViewController
-----------------------
Code:
.h

    NSString *core;


@property (nonatomic, retain) NSString *core;


.m

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:core]];
NSLog(@"core is => %@",core);
every time core is null

i also try


DetailViewController
-----------------------
Code:
.h

    NSString *core;


@property (nonatomic, retain) NSString *core;

-(void) getcore:(NSString*) cores;


.m

-(void) getcore:(NSString*) cores{
    cores = [core retain];   
}

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:core]];
NSLog(@"core is => %@",core);

RootViewController
---------------------
Code:
.h

    NSString *core;


@property (nonatomic, retain) NSString *core;


.m

DetailViewController *DetailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];


[storeDetailViewController getcore:core];
with the same result.
 
Old January 19th, 2012, 12:54 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

Based on what you have posted, you have never allocated, initialized or set the string to any characters. You are trying to open a URL with a string whose value is NULL. What is the value the NSString is supposed to be set to?
Bob





Similar Threads
Thread Thread Starter Forum Replies Last Post
(re-)connecting xib and viewController [xcode 4] briomusic BOOK: Beginning iOS 4 Application Development 1 July 1st, 2011 12:45 PM
sending xml parameswaranvv XML 1 September 23rd, 2008 01:41 PM
sending sms abcd_wxyz56 General .NET 0 November 17th, 2006 01:42 AM
sending mail anita VB How-To 3 September 30th, 2004 03:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.