iphone-sdk-3.0

possible bug?

[亡魂溺海] 提交于 2019-12-07 10:31:31
问题 I been trying this in my code and it doesn´t work: NSArray *paths = [aUITableView indexPathsForVisibleRows]; An empty NSArray is returned. But if I do this in the previous line it works fine....is this a framework bug? NSArray *cells = [aUITableView visibleCells]; NSArray *paths = [aUITableView indexPathsForVisibleRows]; The thing is I don`t really need the cells array. So I´m getting a warning for the unused variable....and I don´t like warnings in my code. jeje. 回答1: It looks like a bug –

Core Data Store Sharing between iPhone Apps

╄→尐↘猪︶ㄣ 提交于 2019-12-07 07:51:40
问题 Is it possible to share a core data store between two different iPhone apps signed by the same developer? I would like to develop an application where one iPhone app will save a stream of data, which can then be read by the other app. Is this even possible? Thanks a lot! 回答1: No, that's not possible. An iPhone application runs in a sandbox and though doesn't have access to another applications data store. Edit: After reading the others answers here: Yes, Custom URLs are possible. And yes it's

ABPeoplePickerNavigationController - remove “Cancel” button without using private methods/properties?

狂风中的少年 提交于 2019-12-07 06:41:40
问题 I'm using the ABPeoplePickerNavigationController, a subclass of UINavigationController, and in the context I'm using it the default nav bar button for the right side, "Cancel", makes no sense. I can't find a way to disable or hide it, and whatever method used needs to be public and store-approvable. Getting rid of the nav bar entirely (picker.navigationBarHidden = YES;) might be an option except that after popping back to the list of contacts the nav bar reappears. Subclassing

Monotouch set status bar Hidden - API change secure

可紊 提交于 2019-12-07 05:06:40
问题 How can I hide the status bar in a Monotouch application in such a way that it is backwards compatible on iOS 3.X while developing on iOS >= 4.X? 回答1: If you ever needed to set the status bar hidden in Monotouch App, and wanted to do it properly for code that runs backward compatible on OS 3.X while developing on iOS SDK 4.X and also for newer devices, here is the answer: if (UIApplication.SharedApplication.RespondsToSelector(new Selector("setStatusBarHidden: withAnimation:"))) UIApplication

Using NSNumberFormatter to format currency in output UILabel

好久不见. 提交于 2019-12-07 03:13:22
问题 NSNumberFormatter * fmt; NSNumber * n; fmt = [ [ NSNumberFormatter alloc ] init ]; n = [ NSNumber numberWithFloat: 10 ]; [ fmt setFormatterBehavior: NSNumberFormatterBehavior10_4 ]; [ fmt setCurrencySymbol: @"$" ]; [ fmt setNumberStyle: NSNumberFormatterCurrencyStyle ]; // NSLog( @"%@", [ fmt stringFromNumber: n ]; [ fmt release ] -(IBAction)buttonPressed1:(id)sender { double currency = [Amount1.text doubleValue] + [Amount2.text doubleValue]; SumCurrency.text = [NSString stringWithFormat:@"%0

How can I use a UIScrollView to change values, just like a UISlider?

馋奶兔 提交于 2019-12-07 00:39:36
So a UISlider works great to change/choose values but it just doesn't look that great. What i'd like to implement is more like a horizontally spinning dial. I already have all the graphics I need and i've already implemented the scroll view to slide my image left and right. The problem at this point is that unlick in a UISlider where I can simply call slider.value to get its value, I have no clue how to set a range of values (max and min) and how to get the specific value out of a UIScrollView as it's scrolling. I have to admit to not being 100% sure how you're using a scrollview as a slider,

Converting a CGRect of a object in a subview in UITableViewCell in UITable to CGRect with respect to self.view

荒凉一梦 提交于 2019-12-06 18:24:53
问题 I want to convert a CGRect "aRect" of a object in a subview in UITableViewCell in UITableView to CGRect with respect to self.view . The problem is that aRect is with respect to the subview in the table cell. But i want to make it so that it is with respect to self.view . What i tried is this rect = [self.view convertRect:aRect.frame toView:cellView]; but it doesn't work. So how to convert it? 回答1: Since convertRect:toView: actually deals with a CGRect in the receiver’s coordinate system,

-[<CALayer: 0x5584190> display]: Ignoring bogus layer size

♀尐吖头ヾ 提交于 2019-12-06 18:17:20
问题 -[<CALayer: 0x5584190> display]: Ignoring bogus layer size (255211754908294243945860531626574872576.000000, 340282346638528859811704183484516925440.000000) Can any one please tell me whats this warning about? The app is crashing on some devices showing this.. Any suggestion would be greatly helpful. 回答1: I believe this is caused because the layer is too large and I expect this will cause issues buffering to an image for drawing. I had this problem with a large UIView with relatively simple

Turn off or fix Bounce Zoom warning from iPhone XIB compilation

时光总嘲笑我的痴心妄想 提交于 2019-12-06 16:11:04
This has been annoying me for a while in several XCode projects. I really don't like to have compiler warnings when I build. When I build my current project, I get the following warning from a bunch of XIB files: /.../CaseInformationView.xib:3:0 UIScrollView's 'Bounce Zoom' option will be ignored on iPhone OS versions prior to 2.1. Since I'm building for 3.0, I don't care if it will be ignored. If I want to use the Bounce Zoom option in my XIB file, how can I not see this warning? Ben Gottlieb In IB, select "Document Info" from the Window menu and set your Deployment target to 3.0. EDIT: In

iphone - AVAudioRecorder gives mono playback (sound playing in just one channel)

三世轮回 提交于 2019-12-06 15:51:29
I am using AVAudioRecorder to record audio and save to a wav file (using SDK 3.0) The settings dictionary contains the following values NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; [recordSetting setValue :[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey]; [recordSetting setValue :[NSNumber