Skip to main content

Posts

Showing posts with the label ios5

UISegmentedControl change event not firing in iOS5

I have a UISegmentedControl whose "Value changed" event is wired up in Interface Builder to call my controller's -(IBAction)segmentChangeAction:(id)sender; When the user taps on the control to change the selected segment, as expected segmentChangeAction is called whether in iOS4 or iOS5. When I programmatically change the selected segment through segmentedControl.selectedSegmentIndex = newIndex; , on iOS4 segmentChangeAction is called and the segment reflects the new selection. However on iOS5 segmentChangeAction is not called, yet the segment does reflect the new selection. Is this a change in iOS5? Is there anything I can do to get segmentChangeAction called on iOS5 when I programmatically change the selection?

connectionDidFinishLoading called before didReceiveData with rails production sending photos

I have a rails 3.0.3 website that, in development mode, responds to a HTTP GET by calling didReceiveData and then connectionDidFinishLoading, and photo data is sent from the website to the iPhone and displayed correctly. But when I run the rails 3.0.3 website in production mode, connectionDidFinishLoading is called before didReceiveData. I'm using carrierwave to handle the photos for both the development and production rails sites. Does anyone have any idea what could cause connectionDidFinishLoading to get called before didReceiveData? I've tried checking the following: 1) I made sure the NSURLConnectionDelegate is called for the class' interface. 2) didReceiveResponse gets called before connectionDidFinishLoading and the statusCode = 200. 3) In the rails app I am using send_file to send the photo data, and the path to the file sent in production, is an actual photo. 4) I checked that data was being returned from the production website by using the code below

Video compression changes custom tab bar in iOS 5

I have implemented a custom tabbar in my app. Where I can scroll on the tab, and also the tab can have more than 5 buttons. The problem is when i pick a video with imagepickercontroller, the compressing video dialog box shows up. The video is compressed and when the imagepicker is dismissed, my custom tabBar gets distorted. The default tabbar shows at the bottom of the screen along with my custom tabbar. And this problem is only when i run the app on iOS 5 device. Please help me out here, either tell me how to avoid compression (tried setting the video quality to 'HIGH'), or some way around the compression thing.

Launch a controller from within an active story board

I have a pretty basic app flow that is quite linear, so it fits in with the storyboard quite well. However there is one requirement that I am not sure on how to achieve. Structurally the app flow looks like this. Table View Controller (Master) Static Table View Controller (Detail, bound to a core data model) Launches a modal web view. (uses a delegate for callbacks) Now the requirement is that one of the options on the detail is to set the item as "default". Then if one were to suspend the app and go to the settings app and enable an "auto launch" option, then when resuming the app it should launch the modal web view directly, when dismissed the user is to be returned to the Table View Controller in #1. Initially I was going to terminate the app if the auto launch was enabled, however I have since read that this practice is frowned upon. So my confusion is, the user could be at any stage through the storyboard, then suspends the app, enables the

iOS WebView > Display only main-content from a website including pictures

How do I fetch just the main-content part of a webpage and display it in an UIWEBVIEW? Link to the page When I look at the code of the webpage I see that the 'What is new?' posts appear below: <div id="content-header" class="clearfix"> <a name="main-content" id="main-content"></a> <h1 class="title">Aktuell</h1> </div> <!-- /#content-header --> Is it possible to relate to id="main-content within the UIWEBVIEW to display just this part of the website instead of the whole page? Screenshot shows visually what I like to get. P.S This is my code to display the whole webpage: - (void)viewDidLoad { [super viewDidLoad]; NSString *golfClubURL = @"http://golfplatz-altenstadt.de"; NSURL *loungeURL = [NSURL URLWithString:golfClubURL]; NSURLRequest *myrequest = [NSURLRequest requestWithURL:loun

Error in calling xml parser method

I am using retailligence barcode api and using nsxml parser method to parse the response below is the code but it didn't give call to parsing method. What's wrong there. Please help { NSString *myxmlstr = [NSString stringWithFormat:@"http://apitest.retailigence.com/v1.2/products?apikey=rMMzX5IDYVmTjQ3A7D9sZXukjKiZVmdD&barcode=%@&latitude=37.439097&longitude=-122.175806",brcode]; NSLog(@"my myxmlsstr is %@",myxmlstr); dataselected = NO; NSURL * xmlURL = [NSURL fileURLWithPath:myxmlstr]; myParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL]; myParser.delegate = self; BOOL success = [myParser parse]; if(success){ NSLog(@"Properly done "); } else{ NSLog(@"not done"); } } Thanks in advance.

Resume Updating views after time is invalidated

Time is invalidated to pause the views from updating because pause button was hit to pause the audio file. Next step is when user hits pause button again to resume audiofile, views should also start updating. -(void)playpauseAction:(id)sender { if ([audioPlayer isPlaying]){ [sender setImage:[UIImage imageNamed:@"play.png"] forState:UIControlStateSelected]; [audioPlayer pause]; [timer invalidate]; } else { [sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal]; [audioPlayer play]; self.timer = [NSTimer scheduledTimerWithTimeInterval:11 target:self selector:@selector(displayviewsAction:) userInfo:nil repeats:NO]; } } - (void)displayviewsAction:(id)sender { FirstViewController *viewController = [[FirstViewController alloc] init]; viewController.view.frame = CGRectMake(0, 0, 320, 480); [self.view addSubview:viewController.view]; [self.view addSubview:toolbar]; self.timer = [NSTimer scheduledTimerWithTimeInterval:

When is it best to do an NSManagedObjectContext save?

I have noticed that for a mobile application, saving on the main thread seems to take a bit when it compares to other applications on the device. Is it recommended to only save Core Data when the application enters the background or when an application closes instead of anytime items are added and sent / received from the api?

Unrecognized selector sent to instance?

I have seen that a few others have had this problem as well. I'm trying to follow a tutorial online that shows how to create animated pins on a MapView. I have implemented the code as shown in the tutorial and the project builds fine except I receive this exception: -[MKPointAnnotation iconN]: unrecognized selector sent to instance I have a subclass of 'MKPinAnnotationView' and in the .m file I create this method: - (void)setAnnotation:(id<MKAnnotation>)annotation { [super setAnnotation:annotation]; //Place *place = [[Place alloc] init]; Place *place = (Place *)annotation; //The following line is where the program sends "SIGABRT" icon = [UIImage imageNamed:[NSString stringWithFormat:@"pin_%d.png", [place.iconN intValue]]]; [iconView setImage:icon]; } Here are a few parts from my "model" which is called Place.h/.m. Here is where I create the property for 'iconN'. @property (retain, nonatomic) NSNumbe

Iphone app that scans for networks in the area

I have a question; I want to be able to make an iPhone iOs5 app which can scan for networks and afterwords and prefereable filter one out [on SSID, for example], and show this in a list Im looking for a class than can handle this but Im finding a lot of classes that handles services in a network..

Parsing JSON Feed iOS 5

I'm pretty new to iOS development, and I'm wanting to parse the values of a JSON twitter feed, so I can pull them through into a tableView. So far, I have the information from the feed logging into my console bar as a string, but I'm stuck with where to go next. My current code is: - (void)loadTweets { NSString *twitterURL = [NSString stringWithFormat:@"https://api.twitter.com/1/statuses/user_timeline.json?screen_name=evostikleague&count=%d", tweetCellCount]; NSURL *fullURL = [NSURL URLWithString:twitterURL]; NSError *error = nil; NSData *dataURL = [NSData dataWithContentsOfURL:fullURL options:0 error:&error]; NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding]; NSLog(@"Everything:\n%@", strResult); } Which gives me the raw data from the feed: [{"id_str":"171930825225551872","coordinates":null,"in_reply_to_status_id_str":null,"place":null,"po

Go to Navigation Controller scene from Navigation Controller that is inside a Tab Bar Controller

I've got following hierarchy in my storyboard: Navigation Controller A -> UIView B (without Nav bar) -> Tab Bar Controller C -> Navigation Controller D -> UITableView E (with Nav bar D and Table bar C) Now I want to go from UITableView E to UIView B. When I use a push segue, my Tab Bar Controller C and Navigation Controller D is preserved. I don't want that. My full scene has to be replaced with UIView B that doesn't got any Nav or Tab bars. How do I achieve this with storyboards?

Cylinder in OpenGL ES on iOS 5

I am pretty new in OpenGL ES and been searching the paste few days after some examples or tutorials about creating cylinders, but unfortunately without any luck! If anybody has some sample code or anything that might be of any use it would be highly appreciated. Thanks in advance.

What triggers iOS 5.0 cache purge?

As of iOS 5.0 Apple began to purge or clean the Caches directory inside individual applications when it decided the device was using too much space. Can anyone point me to the location of documentation or anecdotal information regarding at which threshold this cache cleaning occurs (for instance 90%+ disk usage) and how often it is checked?

Share Kit Scrolling Porblem

I am working on Share kit in both iOS 4.0 and iOS 5.0. When my twitter page opens it works fine in 4.0 but in iOS 5.0 the navigation bar of twitter page become disturbed when Scroll the Webpage. If any one have any solution, share with me... Thanks in Advance

How to programmatic segue from one UIViewController to another without Modal or Push?

If one UIViewController is a login screen, and the next one is the app's home screen, what would be the most optimal way to program the transition. I figure the modal segue class is inappropriate for this situation since ideally the transition to the home screen would be permanent, not temporary. But Push didn't make any sense either, since the login screen isn't a Navigation controller, and that isn't the functionality I'm looking for anyway. What would be the best way approach this specific case? Thanks!

Using EventStore, can I create a new iCal calendary type?

So in my app I rely heavily on iCal, and I can add events using EventStore, but only to the "defaultCalendarForNewEvents". I want to make a new calendar just for the events I create in the app, let's say MyApp calendar, which would behave much like the iCal calendars like "Home", "Work", etc. Is there a way to do this progamatically? Right now, I've tried this: EKEventStore *eventStore = [[EKEventStore alloc] init]; NSArray *calendars = [eventStore calendars]; BOOL calendarHasBeenInitialized = NO; for(NSCalendar *cal in calendars) { if([cal.calendarIdentifier isEqualToString:@"Workout Tracker"]) { calendarHasBeenInitialized = YES; } } if(!calendarHasBeenInitialized) { NSString *string = [[NSString alloc] initWithString:@"Workout Tracker"]; NSCalendar *workoutCalendar = (__bridge NSCalendar *)(CFCalendarCreateWithIdentifier(kCFAllocatorSystemDefault, (__bridge CFStringRef)string)); EKCalendar