This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[self.emailAddressField setAutocorrectionType:UITextAutocorrectionTypeNo]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSInteger is a type definition that describes an integer - but it is NOT equivalent to int on 64-bit platforms. | |
NSInteger is defined as int when building a 32-bit app and as long for 64-bit apps. | |
NSNumber is a class that helps you to store numeric types as object. It has methods to convert between different types and methods to retrieve a string representation of your numeric value. | |
If you use a variable day of type NSNumber* the way you did in your example, you are not modifying the value of day but its memory address. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUserDefaults - need to call the synchronize every time you saved the data | |
it isn’t gauranteed it’ll be saved immediately. sometimes it’ll wait XX seconds to do a synchronize on its own but by then the app could crash or the user could close the app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'C' => 'Shipped', | |
'C_NC' => 'In your NOOK Library', | |
'D' => 'Your order cannot be processed. Please contact customer service', | |
'F' => 'Your order cannot be processed. Please contact customer service', | |
'N' => 'Processing', | |
'O' => 'Processing', | |
'P' => 'Your order cannot be processed. Please contact customer service', | |
'V' => 'Processing', | |
'X' => 'Canceled', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//call the segue to put the data you want to transfer | |
- (IBAction)click{ | |
[self performSegueWithIdentifier:@"PUSH_NEXT" | |
sender:[NSDictionary dictionaryWithObjectsAndKeys: | |
self.page.data,@"data",nil]]; | |
} | |
//prepareForSegue - tranfer the data to next viewController and push to the next view controller | |
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
if ([[segue identifier] isEqualToString:@"PUSH_NEXT"]) { | |
NextPageViewController *vc = [segue destinationViewController]; //set destination view controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.scrollView.pagingEnabled = YES; // making the image can scroll one by one | |
+ for(NSInteger i = 0; i < self.imageURL.count;i++){ //doing several loop to add the image on the scroll view | |
+ | |
+ CGFloat xOrigin = i * self.view.frame.size.width; | |
+ UIImageView *awesomeView = [[UIImageView alloc] initWithFrame:CGRectMake(xOrigin, 0, self.view.frame.size.width, self.view.frame.size.height-90)]; | |
+ [awesomeView setImageWithURL:self.imageURL[i][@"2x"]]; | |
+ [self.scrollView addSubview:awesomeView]; | |
+ } | |
+ | |
+ [self.scrollView setContentOffset:CGPointMake([self.tag integerValue] * self.view.frame.size.width, 0) animated:NO];//set offset-- which means the first image show- basing on the width and do calculation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So there is tricky thing (it will happen sometimes) | |
/* | |
* When set a storyboardID in a viewcontroller, and you want to show the navigation item | |
* you need to init NavigationController with rootviewcontoller | |
*/ | |
UIViewControllers *niceVC = [shop instantiateViewControllerWithIdentifier:@"nice"]; | |
UINavigationController *niceNav = [[UINavigationController alloc] initWithRootViewController:nice]; | |
---------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cell.textLabel.text = [NSString stringWithFormat:@" %@", @"indent"]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)aboutSizeOfHeaderview { | |
// In order to show the label in the header view, we need to make the header view has a situable height | |
CGFloat padding = 8.0; | |
CGRect boundingRect = [self.wishListHeaderLabel.text boundingRectWithSize:CGSizeMake(self.view.bounds.size.width - (padding * 2), CGFLOAT_MAX) options:(NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} context:nil]; | |
UIView *header = self.tableView.tableHeaderView; | |
CGRect rect = CGRectMake(0, 0, self.view.bounds.size.width, | |
boundingRect.size.height + 10.0f); | |
header.frame = rect; | |
self.tableView.tableHeaderView = header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(XHR) { | |
var send = XHR.prototype.send; | |
XHR.prototype.send = function(data) { | |
var self = this; | |
function onReadyStateChange() { | |
if(self.readyState == 4 ) { | |
windows.location = 'ajaxHandler://' + self.url; | |
} | |
} |
OlderNewer