NSString *testStr = @"This is a test work.";
testStr = [testStr stringByReplacingOccurrencesOfString:@"work" withString:@"word"];
A Storyboard is:
- A container for all your Scenes (View Controllers, Nav Controllers, TabBar Controllers, etc)
- A manager of connections and transitions between these scenes (these are called Segues)
- A nice way to manage how different controllers talk to each other
- Storyboards give you a complete look at the flow of your application that you can never get from individual nib files floating around.
- A reducer of all the "clutter" that happens when you have several controllers each with it's own nib file.
I have been using Storyboards for awhile now and the ONLY downside is that you can't target iOS 4 or below. Storyboards only work on devices running iOS 5 or better. Other than that, the benefits are many and the downsides are non-existent IMO.
The best tutorial I have seen is Ray Wenderlich's
Also, if you are a member of the Apple Developer program, check out last years WWDC session on Storyboards (iTunesU), it is awesome.
Another great one (also on iTunesU) is the latest Stanford iOS Application Programming course.
I need only read a txt file at my server on my X-Code project.
And thats the way:
NSString* myFile = [NSString stringWithFormat:@"http://www.yourdomain.com/yourfile.txt"];
NSString* myFileURLString = [myFile stringByReplacingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSData *myFileData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:myFileURLString]];
NSString *returnedMyFileContents=[[[NSString alloc] initWithData:myFileData encoding:NSASCIIStringEncoding] autorelease];