cocoa-touch

Is there a way to make a native cocoa class library in MonoTouch?

醉酒当歌 提交于 2020-01-03 16:57:30
问题 I know that MonoTouch compiles code down to native machine code. Is there anyway to make a native (.a) class library using MonoTouch? Just to be clear, I'm not looking to share code between the two since I know that is not possible. 回答1: I believe it might be possible, but it would be hard work, and it's a long way from shrink-wrapped out-of-the-box functionality. For reference, take a look through the answers on Is there a way to mix MonoTouch and Objective-C? - that question is about how to

Finding the locale-dependent first day of the week

天大地大妈咪最大 提交于 2020-01-03 16:45:08
问题 Given an NSDate , how do I find the first day of that date's week, given the user's locale. For example, I've heard that some countries treat Monday as the first day of the week and others use Sunday. I need to return the preceding Monday in the first case but the preceding Sunday in the latter case. My best effort thus far always returns the preceding Sunday, regardless of the device settings applied: NSCalendar *calendar = [NSCalendar currentCalendar]; [calendar setLocale:[NSLocale

How to automatically insert a decimal place on the iphone?

社会主义新天地 提交于 2020-01-03 14:39:33
问题 I know this has been asked a few times in the past but everything I try is failing. I have a custom numeric keypad with a UILabel. When I hit the '1' the UILabel displays a one. Now here's what I'm trying to do: When I hit the '1' button I want: 0.01 in the UILabel Followed by a '4' button I want: 0.14 in the UILabel Then a '6': 1.46 etc, etc. Now the keyboard and UILabel are working great. I just need to get the decimal's working now. Any sample code would be great, (and where I should place

How to automatically insert a decimal place on the iphone?

£可爱£侵袭症+ 提交于 2020-01-03 14:39:26
问题 I know this has been asked a few times in the past but everything I try is failing. I have a custom numeric keypad with a UILabel. When I hit the '1' the UILabel displays a one. Now here's what I'm trying to do: When I hit the '1' button I want: 0.01 in the UILabel Followed by a '4' button I want: 0.14 in the UILabel Then a '6': 1.46 etc, etc. Now the keyboard and UILabel are working great. I just need to get the decimal's working now. Any sample code would be great, (and where I should place

Detect URL in NSString

本小妞迷上赌 提交于 2020-01-03 10:56:32
问题 I'm currently using a UITextView in a UITableViewCell in order to make links clickable, but this is giving very poor performance. So I was wondering if it's possible to detect links in a NSString and if there is a link, use the UITextView , otherwise just use a UILabel . 回答1: Absolutely. Use NSDataDetector (NSDataDetector Class Reference) 回答2: I guess you are familiar with regexes to detect URLs, so in order to get one or the other type of view in your cell, you can simply return two

UIView layer rounded corners and -drawRect:

拈花ヽ惹草 提交于 2020-01-03 08:48:11
问题 Is it possible to set rounded corners on an UIView 's layer and override -drawRect: at the same time? Currently the -drawRect: call seems to override the layer's rounded corners and make them appear angular again, even if the -drawRect: just contains a call to the super's -drawRect: . 回答1: self.opaque = NO didn't work for me. Setting self.layer.masksToBounds = YES did work, however (tested on iOS 4.3): - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if( self ) { self

loaded the “ChatView” nib but didn't get a UITableView.'

此生再无相见时 提交于 2020-01-03 08:39:16
问题 I have a custom UITableViewController ("ChatView") that has an Output for a tableView. In the interface builder I have connected the tableView in the nib to the outlet. When the view loads I get the above error. The view is loaded via a tabcontroller. I have done some research about the error and I can't seem to track down the issue. I would appreciate if someone could get me going in the right direction to resolve this. @interface ChatViewController : UITableViewController

How do I set the contents of a CALayer to a CGImageRef?

大兔子大兔子 提交于 2020-01-03 08:29:29
问题 I want to set the contents of a CALayer to an image. The CALayer has a contents property The documentation on that property says that "a layer can set this property to a CGImageRef to display the image as its contents." But the property takes an id so in Xcode I get the following issue: Semantic Issue: Incompatible pointer types assigning to 'id' from 'CGImageRef' (aka 'struct CGImage *') How can I assign a CGImageRef to the contents property when it only takes an id ? What am I missing here?

Use of @synthesize/@property in Objective-C inheritance

隐身守侯 提交于 2020-01-03 07:36:08
问题 If you have Class A with an instance var "foo" which has a @property/@synthesize directive, and Class B inherits from Class A, does it also need to @property/@synthesize "foo"? The reason I ask is because when I try to use Class B's "foo", the calling class says that "foo" is not something of a structured union or a member, which makes me believe it needs to be explicitly synthesized. 回答1: No, you don't. Synthesized properties are added to class A and its subclasses automatically. 回答2: If you

Google Delegates on Calendar Framework / EventKit

只愿长相守 提交于 2020-01-03 07:21:23
问题 I have always run with the assumption that Google delegates can be viewed by iCal and the calendar.app, but are not visible to us developers through the calendar framework, or EventKit. Has this changed? 回答1: I have the problem too. Calendars show up twice. Deselect the delegates. A little later everything disappears. Apparently its a problem on google's side. They claim to be "working on it" Check discussion I found the google thread on another apple forum page devoted to the same problem