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.
http://stackoverflow.com/questions/9083759/what-are-the-benefits-of-using-storyboards-instead-of-xib-files-in-ios-programmi
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];
NSLog(@"%@", returnedMyFileContents);
Speech-to-Text library used by Astrid for iPhone!
https://github.com/todoroo/iPhone-Speech-To-Text
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.
http://codeshaker.blogspot.com/2012/05/alternatives-to-performselector.html
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 :
//DataClass.h
@interface DataClass:NSObject{
NSMutableArray *arrGlobal;
}
@property(nonatomic,retain) NSMutableArray *arrGlobal;
+(DataClass*)getInstance;
@end
//DataClass.m
@implementation DataClass
@synthesize arrGlobal;
static DataClass *instance =nil;
+(DataClass*)getInstance
{
@synchronized(self){
if(instance==nil){
instance = [DataClass new];
}
}
return instance;
}
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.
http://stackoverflow.com/questions/7636057/can-i-have-a-single-nsmutablearray-in-my-multiple-views-application
UIView
siblings are stacked in the order in which they are added to their superview. The UIView
hierarchy methods and properties are there to manage view order. In UIView.h:
@property(nonatomic,readonly)UIView*superview;
@property(nonatomic,readonly,copy)NSArray*subviews;
-(void)removeFromSuperview;
-(void)insertSubview:(UIView*)view atIndex:(NSInteger)index;
-(void)exchangeSubviewAtIndex:(NSInteger)index1 withSubviewAtIndex:(NSInteger)index2;
-(void)addSubview:(UIView*)view;
-(void)insertSubview:(UIView*)view belowSubview:(UIView*)siblingSubview;
-(void)insertSubview:(UIView*)view aboveSubview:(UIView*)siblingSubview;
-(void)bringSubviewToFront:(UIView*)view;
-(void)sendSubviewToBack:(UIView*)view;
The sibling views are ordered back to front in the subviews
array. So the topmost view will be:
[parentView.subviews lastObject];
and bottom view will be:
[parentView.subviews objectAtIndex:0];
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.
http://stackoverflow.com/questions/4631878/how-to-set-iphone-ui-view-z-index
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
var query = invoiceList
.GroupBy(g => new { g.InvoiceDate,
g.InvoiceType })
.Select(group => new {
InvoiceDate = group.Key.InvoiceDate,
InvoiceType = group.Key.InvoiceType,
TotalAmount = group.Sum(a=>a.InvoiceAmount),
TotalCount = group.Sum(c=>c.NumberOfItems)});
http://msmvps.com/blogs/deborahk/archive/2010/05/03/grouping-and-summing-with-lambda-expressions.aspx