ios5

Overriding setters with arc and dynamic properties

和自甴很熟 提交于 2020-01-14 14:56:05
问题 I need to do some additional stuff in a setter method. But I get an infinite loop when doing so: I've got a core data object @interface Transaction : NSManagedObject @property (nonatomic, retain) NSDate * date; @end @implementation Transaction @dynamic date; -(void)setDate:(NSDate *)date { self.date = date; //additional stuff omitted } So, in that case I get an infinite loop. Okay so I searched on the net and modified my code in the following way and for every version I get compiler errors

reloadData doesn't work

北慕城南 提交于 2020-01-14 14:12:23
问题 i'm trying to update my UITableview but when i call [tableView reloadData]; the table doens't update, after i scroll the tableview above the name of the cell while be changed. But it's not adding a new row or something like that. -(void)update { [tableView reloadData]; NSLog(@" %i", [tableData count]); } The nslog it's returing 1 when i add a row it's returning 2 but the table is not updating. - (void) refresh:(id)sender { NSString *jsonString = [NSString stringWithContentsOfURL:[NSURL

Check for substring of NSString crashing

你离开我真会死。 提交于 2020-01-14 09:46:09
问题 I've tried checking for an occurrence of a substring in an NSString in two ways, both have crashed. This is an NSString object I get from one of my NSManagedObject's properties. Using NSRange NSString *searchString = @"drive"; NSRange range = [text rangeOfString:searchString options:(NSCaseInsensitiveSearch)]; if (range.location != NSNotFound) { NSLog(@"Found"); } Using NSScanner NSScanner *scanner = [NSScanner scannerWithString:text]; NSLog(@"%d",[scanner scanString:searchString intoString

Autoplay audio with iOS 5 Mobile Safari, any workarounds left?

给你一囗甜甜゛ 提交于 2020-01-14 04:16:11
问题 We all know Apple doesn't allow autoplay on html5 audio tags with Mobile Safari. The workaround for iOS 4 was to use an iframe with an mp3 src. Apple seems to have patched this on iOS 5. <html> <body> iframe mp3 autoplay test <iframe src='iframe.mp3' width='0px' height='0px' scrolling='no'></iframe> </body> </html> This works on iOS 4.3.1, but not on 5.0.1. Any workarounds left, or has Apple finally patched all the autoplay loopholes? 回答1: The answer might be inside of this post here, of

Custom Navigation Bar in iOS 5

拈花ヽ惹草 提交于 2020-01-14 04:04:28
问题 I use a class to style the NavigationControllers in iOS 5. The problem I have is the moreNavigationController which is created automatically. I found a way to style the moreNavigation itself, if ([[[UIDevice currentDevice] systemVersion] intValue] >= 5.0){ [self.rootController.moreNavigationController.navigationBar setBackgroundImage: [UIImage imageNamed:@"noten_header.png"] forBarMetrics:UIBarMetricsDefault]; } but i have no clue how I style the edit view of the moreNavigationController (if

Archive the uiview controls (uiimageview,uiscrollview,uitableview,uibutton)

与世无争的帅哥 提交于 2020-01-14 03:37:09
问题 Am archive and unarchive the uiview and display the view in ipad this controls (uiimageview,uiscrollview,uitableview,uibutton) were not displayed....but uiview subviews all controls are there ....Is it possible to get that controls(uiimageview,uiscrollview,uitableview,uibutton) in view? possible means how to get that controls to display in view. uiview *viewForArchive; uiview *newCir=[uiview alloc ]initwithframe:cgrectmake(0,0,768,1024)]; //archiving NSMutableData *d= [NSMutableData data];

Refresh a UIWebView

爱⌒轻易说出口 提交于 2020-01-14 03:27:08
问题 I'm looking for a simple way of adding a refresh mechanism to my UIWebView. I've seen posts about the EGO pull to refresh but, to be honest, I don't understand how that works, especially since I have no clue on how to use it with a UIWebView instead of a table view. And it seems to me like a lot of overhead for just a simple refresh. I thought about adding a navbar but instead of a back button, add a custom "refresh" one. But based on what I've found so far, it seems as complicated as the

Rotating Two UIImageView in X Direction

送分小仙女□ 提交于 2020-01-14 03:15:08
问题 i wanna rotate two images i put one images behind the other but when i rotate them with the following code the back image will be above the front image and i assign their ZPOstion but their is no change this link for my view before rotate http://i39.tinypic.com/ivv2ah.png and after rotate http://i43.tinypic.com/ic05xj.png how this happen [UIView animateWithDuration:0.2 animations: ^{ CALayer *myLayer=self.image2.layer; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@

Remove the UITableView Section Border and Background Color with Static Cells ?

六月ゝ 毕业季﹏ 提交于 2020-01-13 20:33:07
问题 I am using UITableView with static cells to make a small form. I added number of sections in the UITableView but now I have to remove the background color and the border of the section that displays the Login and Forgot Password button. Check out the screenshot below. Question 1 How can I remove the background color and the border? Question 2 Also is there anyway to change the background color of the view. This view inherits from UITableViewController . I believe that I need to change the

UISegmented Control - setting the tint color of each segment

妖精的绣舞 提交于 2020-01-13 19:10:55
问题 I have been wanting to apply different colors to my UISegmentedControl segments. Many people on here have been asking how to set tint color when you press on a certain segment. What i want to do is to set the tint color of each segment throughout the life of the application(or when the view appears on the screen). Scanning the questions on here, different people have pointed out that evidently in iOS 6 you cannot set the tintColor of each segment as such: - (void)viewDidLoad { [super