iphone-sdk-3.0

iPhone “touchesBegan” and “touchesMoved” message … do not move to centre of touch

五迷三道 提交于 2020-01-16 16:15:39
问题 I am modifying the "MoveMe" example from the apple web site. When my controller gets the "touchesMoved" message it moves the object being moved to the centre of the touch, because (pseudocode) object.center = touch.center. How can I store the offset of the initial touch so that if I start the touch/drag to the side my finger will stay on that spot while I drag it around? 回答1: You can store target_view.frame in an instance variable when touchBegan message arrives. 回答2: Can't you store that in

How to rotate a needle (for a sound level meter) about it origin?

谁说胖子不能爱 提交于 2020-01-16 14:41:43
问题 Hi so this is my situation up to now. I've added a UIImageView to Interface Builder and set it to a .png image of a needle (Needle.png), I've also connected it to the corresponding IBOutlet in Xcode. In my viewDidLoad: method I set the anchor point, - (void)viewDidLoad { [super viewDidLoad]; [needle.layer setAnchorPoint:CGPointMake( 0.5, 1 )]; } And I've also created a button in Interface Builder and connected it to an IBAction in Xcode, this button performs an animation block, - (IBAction

Error on CLLocation subclassing

守給你的承諾、 提交于 2020-01-16 00:46:53
问题 I'm trying to make a new CLLocation subclass. This is the skeleton: #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> @interface JFLocation : CLLocation { } @end #import "JFLocation.h" @implementation JFLocation @end When I build the class I'm getting this errors: Undefined symbols: ".objc_class_name_CLLocation", referenced from: .objc_class_name_JFLocation in JFLocation.o ld: symbol(s) not found Any Idea?? Thank you!! 回答1: You should add CoreLocation.framework to the frameworks

Error on CLLocation subclassing

时光总嘲笑我的痴心妄想 提交于 2020-01-16 00:46:07
问题 I'm trying to make a new CLLocation subclass. This is the skeleton: #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> @interface JFLocation : CLLocation { } @end #import "JFLocation.h" @implementation JFLocation @end When I build the class I'm getting this errors: Undefined symbols: ".objc_class_name_CLLocation", referenced from: .objc_class_name_JFLocation in JFLocation.o ld: symbol(s) not found Any Idea?? Thank you!! 回答1: You should add CoreLocation.framework to the frameworks

CPTGraphHostingView in a UIView

北慕城南 提交于 2020-01-15 08:58:14
问题 I was really impressed, and really grateful about the answers I recived last time I asked here. I have this problem with Core Plot. I want to have a CPTGraphHostingView inside my UIView so I can have things like labels and scroll views below it. I am using XCode 3.2 by the way. How do I do this programmatically? Or with the Interface builder if possible.(I need the instructions to be detailed as im I bit new to this sort of thing) Thanks for your support. 回答1: If you want to add a core plot

Signature invalid only for ad hoc

爱⌒轻易说出口 提交于 2020-01-15 07:53:32
问题 I'm not sure what changed on my ad hocs but I get this error when trying to install: Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011) Device debug builds fine. The cert that is associated with my ad hoc provisioning profile doesn't expire until 2011. I've searched Google but haven't found any applicable solution, except some mention about deleting and recreating the certs. Before I go down that rode, has

Which iPhone SDK to download?

筅森魡賤 提交于 2020-01-15 03:55:10
问题 In the developer center there are two different downloads for the SDK, one for Leopard and one for Snow Leopard. Which do I download? Also do I have to download a separate copy of xcode as well or is it part of the download? Thank you. 回答1: Snow Leopard is the version of Mac OSX slated to be released in late 2009, if you do not have Snow Leopard you should use the Leopard version. Leopard = Mac OS X Version 10.5.x Snow Leopard = Mac OS X Version 10.6.x (you can find this by clicking on the

UITableView gives empty table, does not load data

*爱你&永不变心* 提交于 2020-01-14 14:08:59
问题 Everything works fine when the view that holds my table is the main (first) view. However, when it's not the first view and I switch into that view, my table does not load data and I get an empty table . Using NSLog I can tell that the program is not invoking numberOfRowsInSection and cellForRowAtIndexPath . I have <UITableViewDataSource, UITableViewDelegate> , IBOutlet UITableview *tableView all declared. They are also connected in the InterfaceBuilder. I tried using viewWillAppear and

Loading huge Text file in UITextview crashes

耗尽温柔 提交于 2020-01-14 13:59:07
问题 I want to update a huge text file in UITextView. But the device just hangs or crashes some times. The text file size is 4MB. The UITextView is been added from Interface Builder. I am loading the file from document directory. Below is the code for loading the text file:- NSError *err = nil; txtView.text =[NSString stringWithContentsOfFile:documentPath encoding:NSUTF8StringEncoding error:&err]; As I want to edit the file I cannot load it in WebView which is much faster and it works properly. Is

Objects Sorting With date ,Time Problem in Array(Iphone Development)

徘徊边缘 提交于 2020-01-14 04:57:05
问题 I have Problem related to array Sorting. I have an NSMutable array say's A.Which has an class object b on its each index. class b contain's multiple field Like int,string and nsdate. I want to sort the A array on the basis of class b time(NSdate) ascendingly. I follow the date sorting question on stackoverflow but that's only for date array. Sort NSArray of date strings or objects Kindly guide me. Thank's in advance 回答1: Here you go just modify some part of code for your requirement -