iphone-sdk-3.0

MKMapView : setRegion doesn't work !

时光毁灭记忆、已成空白 提交于 2019-11-27 16:55:18
问题 Aaaarg... ok, let's calm myself. Did someone have any problem with setting the region of a MKMapView ? It never worked with me. This code : -(void)setUserCenteredSpan:(MKCoordinateSpan)span{ // for this example, span = {0.5, 0.5} // Current region (just initialised) NSLog(@"%f, %f - %f, %f", self.region.center.latitude, self.region.center.longitude, self.region.span.latitudeDelta, self.region.span.longitudeDelta); // New Region MKCoordinateRegion region = MKCoordinateRegionMake([[[self

How can my server securely authenticate iPhone in-app purchase?

扶醉桌前 提交于 2019-11-27 16:53:55
Look at Apple's diagram for the server purchase model . In step #9, how can the server know that it is really talking with an iPhone that is entitled to the purchase, and that Eve is not performing a replay with a dishonestly obtained receipt? The receipt may be valid, but that doesn't prove that the sender is the entitled party. Is there any notion of a device certificate on the iPhone that can be used to sign the receipt? Is there any way to bind the receipt to the device, or bind the receipt to both the iTunes account and to the device, so the server can validate? Apple-Provided Vulnerable

Any way of changing the duration of zoomToRect for UIScrollView?

我是研究僧i 提交于 2019-11-27 16:44:51
问题 Is there any way to specify a duration for the animation of [UIScrollView zoomToRect:zoomRect animated:YES] ? At the moment it's either fast animated:YES or instant animated:NO . I'd like to specify a duration, eg [UIScrollView setAnimationDuration:2] ; or something similar. Thanks in advance! 回答1: Use the UIView's animations. It's a bit long to explain, so I hope this little example will clear things up a bit. Look at the documantation for further instructions [UIView beginAnimations: nil

how to detect and program around shakes for the iphone

房东的猫 提交于 2019-11-27 16:42:35
问题 I'm trying to implement the shake "tutorial" on this page, but I think I'm missing something. I copied his accelerometer function into myAppViewController.m file and put some nslogs in there to see if it even gets into the function when I use the simulators "shake" function. Nothing shows up in the debug console. http://mithin.in/2009/07/28/detecting-a-shake-using-iphone-sdk Can anyone explain what I might be missing? Or point me to a tutorial? I found this, which looks promising, but I don't

Data Formatters temporarily unavailable

馋奶兔 提交于 2019-11-27 14:51:40
Im trying to use Date Formatters (NSDateFormatter), but I keep getting this error: Program received signal: “EXC_BAD_ACCESS”. Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib") This is nothing to do with NSDateFormatter - the message pasted in saying "Data Formatters" is correct. You will get this message in several situations, possibly most commonly when unable to find a linked in shared library at launch time. You may also get it when short of memory while running, in which case

MonoTouch instability continues: managed memory allocator crashes

对着背影说爱祢 提交于 2019-11-27 13:16:56
问题 Long story short: I can allocate tons of unmanaged memory, but trying to allocate the same amount (or far less) in managed memory crashes MonoTouch in GC_remap (callstack below). Details: I'll talk about one example of the behavior I described above. My app allocates a 2.5MB chunk of managed memory (using new byte[]) occasionally, and it often dies on my iPhone4 with the callstack pasted below (i.e. mprotect error during the allocation). I don't keep a reference to these 2.5MB blocks for

Deactivate UIScrollView decelerating

眉间皱痕 提交于 2019-11-27 12:35:49
Is there a way to deactivate the decelerating of a UIScrollView? I want to allow the user to scroll the canvas, but I don't want that the canvas continues scrolling after the user lifted the finger. Mark This can be done by utilizing the UIScrollView delegate method scrollViewWillBeginDecelerating to automatically set the content offset to the current screen position. To implement: Assign a delegate to your UIScrollView object if you have not already done so. In your delegate's .m implementation file, add the following lines of code: -(void)scrollViewWillBeginDecelerating:(UIScrollView *

How to place UIBarButtonItem on the right side of a UIToolbar?

☆樱花仙子☆ 提交于 2019-11-27 12:20:52
问题 I have designed a view with a toolbar that appears modally in Interface Builder. I have a UIBarButtonItem that is on the left hand side, which I would like to appear on the right hand side of the toolbar. How can I do this in IB, or via code? 回答1: Here's how to do it in code if anyone comes across this post: UIBarButtonItem *leftButton = [[[UIBarButtonItem alloc] initWithTitle:@"Item" style:UIBarButtonItemStyleBordered target:self action:@selector(btnItem1Pressed:)] autorelease];

idleTimerDisabled not working since iPhone 3.0

时间秒杀一切 提交于 2019-11-27 12:12:32
I have used: [UIApplication sharedApplication].idleTimerDisabled = YES; in a number of Apps developed and running under iPhone OS 2.x and never had any problems with it. They were clock apps so needed to run constantly and ignore the iPhone's idle Timer setting. However, trying to achieve the same with a new App running OS 3.0 (and which needs to be deployed under 3.0 as it uses some 3.0 APIs) I've found the idle Timer to be either ignored or inconsistent. My App plays music from the iPod library and when the music is playing it auto-locks regardless of the above setting. But once you unlock

How to implement an accordion view for an iPhone SDK app?

耗尽温柔 提交于 2019-11-27 11:30:35
Has anyone seen an implementation of an "accordion" (maybe called "animated outline") view for the iPhone? I found an example project for Cocoa, but before trying a port, I was hoping that someone has invented the wheel already. To make it clear, in a UIView, consider a stack of sections, each containing a header, and then some contents. When the user touches the header (or through some message/event), if the section is already open => close it; if the section is closed => open it and close any other open section. An example in jQuery looks like: http://docs.jquery.com/UI/Accordion In my case,