cocoa-touch

URL decode in objective-c [closed]

a 夏天 提交于 2019-12-25 17:47:09
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . i have a string named url i.e NSString *url = @"http://sound17.mp3pk.com/indian/barfi/%5BSongs.PK%5D%20 Barfi%20-%2001%20-%20Barfi!.mp3"; Now I am downloading this song and to save this I need to specify filename

iPhone: Is it possible to close the app rather than run in background when user clicks Home Button?

坚强是说给别人听的谎言 提交于 2019-12-25 17:03:07
问题 I have an app which crashes everytime when I resume it. I want that when user clicks Home button, the app should close rather than go in background mode. Is that possible? If yes, please let me know. If not, what could be the workaround so that my app does not crash when I resume it? Thanks! 回答1: In the plist, set YES to Application does not run in background key. When ur application is in background, due to memory insufficient, the views (and the objects released in viewDidUnload) might be

iPhone: make a call

偶尔善良 提交于 2019-12-25 16:46:11
问题 Is there a way for my app to call a certain number and to play a certain sound? Thanks. 回答1: You can call a number by requesting the URL tel://###-###-### , but this will quit your application and launch the iPhone's default phone application. There is no way of playing a sound as your application has exited at that point. 回答2: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://91-123******"]]; 来源: https://stackoverflow.com/questions/1239328/iphone-make-a-call

Creating a pop up button interface

坚强是说给别人听的谎言 提交于 2019-12-25 16:43:53
问题 In Apple's stock 'Messages' app, tapping the camera button reveals popup buttons allowing the user to take a photo/video or choose an existing one. How would I implemented this same button design? Is the procedure the same for both iPhone & iPad? 回答1: It's called a UIActionSheet . You use it like this UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"Foo" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"foo1", @"foo2", nil]; [action

Can I have more than 1 UITabBarController?

喜你入骨 提交于 2019-12-25 16:39:37
问题 Lets imagine the scenario: UITabBarController - UITabBar - Tab 1: View Controller A - Tab 2: View Controller B When I click on View Controller A I want to push another UITabBarController: UITabBarController -UITabBar - Tab 1: View Controller 1 - Tab 2: View Controller 2 - Tab 3: View Controller 3 Is this possible? To have a UITabBarController push another UITabBarController onto the view stack? 回答1: You can certainly do this but I would rethink your design. Selecting a UITabBar item and

Inability to create my UIImageView classes from string

99封情书 提交于 2019-12-25 13:47:44
问题 I am creating subclasses of UIImageView class, something like LittleImageView , RedImageView , etc. These subclasses have this convenience method for the creation of specific images: + (UIImageView *)novo { UIImageView *newImage = [[super alloc] initWithImage:... // do stuff return newImage; } When I try to create such classes using this new command by string id newObject = [NSClassFromString(nameOfClass) novo]; I get a crash with "unrecognized selector sent to class". Apparently objective-c

unable to write to a file in AplicationSupport directory

半腔热情 提交于 2019-12-25 12:58:25
问题 I am trying to store some values in a plist in the Application support directory of my iOS app. But the write always fails. I used boiler plate code from iOS documentation. In the code below I always hit an error while doing writeToURL:atomically. I.E I always get a "Failed to write to plist" in the log and the file is never created. The URL appears to be created correctly. This is what I see in the URL print below. URL to store plist is file:///var/mobile/Containers/Data/Application/9E26C447

UIImagePickerController crash on iOS 5

Deadly 提交于 2019-12-25 12:43:13
问题 UIImagePickerController *ii_picker= [[UIImagePickerController alloc] init]; ii_picker.delegate=self; ii_picker.sourceType=UIImagePickerControllerSourceTypeCamera; add_photo=NO; [self presentModalViewController:ii_picker animated:YES]; [ii_picker release]; This used to work fine till I updated to iOS 5 on my iPhone. Something strange... Problem isn't in the code. It's working in blank project! If I paste it to any place in my project's code, it's crashing. If I change

Countdown timer on UITableViewCell, Scrolling/laggy issue of UITableView

我的梦境 提交于 2019-12-25 12:43:11
问题 As per my title, I have Table view which display lottery tickets in each row and each ticket has it's detail view. Ticket has it's own time for draw. Dynamic tickets are display on table view, right now consider 10 to 15 tickets on the table. First time all are working well. But when I scroll table 5 to 6 times up and down OR go in detail of ticket 5 to 6 times then table hang. Issue is only NSTimer, I repeat timer for every second. When I was removed timer then table was not hanged. I also

Not able to reload second compoenent based on value in first component in UIPickerview

假如想象 提交于 2019-12-25 12:18:22
问题 I am working with a UIPickerView and trying to implement the functionality of loading second component with the data that is mapped to value selected in the first component. But, my second component always shows the values that are mapped to second row of my first component. With breakpoints I noticed the values are correctly passed on for - (UIView *)pickerView:(UIPickerView *)iPickerView viewForRow:(NSInteger)iRow forComponent:(NSInteger)iComponent reusingView:(UIView *)iView method. Please