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];
Speech-to-Text library used by Astrid for iPhone!
If you use ARC you may happen to meet this warning message: "PerformSelector may cause a leak because its selector is unknown". In the first half of this article I will give some examples on how to avoid this warning by using some alternate methods, after that I will show other examples for performSelector alternatives on different situations.
If you are having multiple views in your application, and in that case you want to have a variable accessible to every view, you should always create a Model/Data(singleton) class and define the variable in it. Something like this :
@property(nonatomic,retain) NSMutableArray *arrGlobal;
static DataClass *instance =nil;
instance = [DataClass new];
Now in your view controller you need to call this method as :
DataClass *obj= [DataClass getInstance];
obj.arrGlobal = arrLocal;
This variable will be accessible to every view controller. You just have to create an instance of Data class.
UIView siblings are stacked in the order in which they are added to their superview. The
UIViewhierarchy methods and properties are there to manage view order. In UIView.h:
The sibling views are ordered back to front in the
subviews array. So the topmost view will be:
and bottom view will be:
Like Kolin Krewinkel said,
[parentView bringSubviewToFront:view] will bring the view to the top, but this is only the case if the views are all siblings in the hierarchy.
To enable hidden files/folders in finder windows:
- Open Finder
- Open the Utilities folder
- Open a terminal window
- Copy and paste the following line in:
defaults write com.apple.Finder AppleShowAllFiles YES
- Press return
- Now hold ‘alt’ on the keyboard and right click on the Finder icon (ON DOCK)
- Click on Relaunch
You should find you will now be able to see any hidden files or folders. One you are done, perform the steps above however, replace the terminal command in step 4 with:
defaults write com.apple.Finder AppleShowAllFiles NO