cocoa-touch

Why does UIWebView shrink images?

牧云@^-^@ 提交于 2020-01-01 18:15:06
问题 I'm using a UIWebView to display images in base64 (http://www.abluestar.com/utilities/encode_base64/index.php). The UIWebView is set to "Scales Page To Fit" and Mode is "Left". The image might be 400px wide but once rendered in the UiWebView, it takes up not even half of the screen. I need to do something like style="width:800px;..." before it begins to take up most of the screen and is readable (because it isn't so small). Is this the right way? Why does the image shrink in the UIWebView and

How to create an timeline on iPhone

人盡茶涼 提交于 2020-01-01 18:04:12
问题 I am trying to create an inifite timeline in my iPhone app to scroll through time. I think I am going to use a UIScrollView to do that but I am not sure how to do that. Am I supposed to create a reusable queue of views from scratch with views containing the days/months/years and reuse them when they go out of the screen ? (I have in mind the reusable cells from the tableviews). Maybe there is a better way to do that ? Thanks for your help ! 回答1: As far as I know, UIScrollView doesn't have

MFMailComposeViewController Not Dismissing From View

时光总嘲笑我的痴心妄想 提交于 2020-01-01 16:12:45
问题 I have the following code that is called when a button on an action sheet is called. But when I press cancel, then delete draft, it just feezes and does not dismiss. I use the same code elsewhere in my app and its called from a select of a tableview cell and it works find there. Any ideas why it isn't working here? Ther is also no error msg in the console when it freezes. if([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *picker = [[MFMailComposeViewController alloc]

NSInternalInconsistencyException', reason: 'Could not load NIB in bundle while fetching 500+ records from the address book database

孤街醉人 提交于 2020-01-01 14:59:29
问题 I am sorry if this question is getting repeated, but I could not help it since I have tried every possible solution but nothing worked and hence I am asking this question. I am loading almost 500 records in my table view from the address book database at one go. If the records are few ,say 50 or 100, my table is displayed without any problem. But when the number of record goes say 300+, I get a crash which says: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException',

NSInternalInconsistencyException', reason: 'Could not load NIB in bundle while fetching 500+ records from the address book database

天涯浪子 提交于 2020-01-01 14:59:16
问题 I am sorry if this question is getting repeated, but I could not help it since I have tried every possible solution but nothing worked and hence I am asking this question. I am loading almost 500 records in my table view from the address book database at one go. If the records are few ,say 50 or 100, my table is displayed without any problem. But when the number of record goes say 300+, I get a crash which says: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException',

Adding a primary key to a RLMObject requires migration, any ideas how?

六眼飞鱼酱① 提交于 2020-01-01 12:42:24
问题 I'm working on an iOS app with Realm.io as the persistent store. I've just updated one of my custom RLMObject subclasses by adding a primary key. When I run the app, I get an error telling me I need to add migration steps: 'Migration is required for object type 'MY_REALM_OBJECT' due to the following errors: - Property 'property_name' has been made a primary key.' I have other migration code but can't find anything in the Realm docs on how to add a primary key to an RLMObject. Anyone know how

Retrieving all 4 coordinates of a rotated UIImageView

安稳与你 提交于 2020-01-01 12:31:47
问题 How does one get the 4 coordinates for a UIImageView? I know the CGRect can be obtained and the origin.x and origin.y, but how can all 4 corners be found? EDIT: I am rotating the UIImageViews, thats why I asked :P 回答1: You could add width and height of the rectangle to get the coordinates of the other 3 points. CGRect rect = view.bounds; CGPoint topLeft = rect.origin; CGPoint topRight = CGPointMake(rect.origin.x + rect.size.width, rect.origin.y); CGPoint bottomLeft =CGPointMake(rect.origin.x,

Retrieving all 4 coordinates of a rotated UIImageView

感情迁移 提交于 2020-01-01 12:31:09
问题 How does one get the 4 coordinates for a UIImageView? I know the CGRect can be obtained and the origin.x and origin.y, but how can all 4 corners be found? EDIT: I am rotating the UIImageViews, thats why I asked :P 回答1: You could add width and height of the rectangle to get the coordinates of the other 3 points. CGRect rect = view.bounds; CGPoint topLeft = rect.origin; CGPoint topRight = CGPointMake(rect.origin.x + rect.size.width, rect.origin.y); CGPoint bottomLeft =CGPointMake(rect.origin.x,

Add Radio Button in Tableview Got Some Problem

為{幸葍}努か 提交于 2020-01-01 12:21:07
问题 I know xcode don't have radio Button so I try to add a custom button and make it action like a radio button This is the image I use and this is the code I set to cell UIButton *but = [UIButton buttonWithType:UIButtonTypeCustom]; [but setImage:[UIImage imageNamed:@"radio-off.png"] forState:UIControlStateNormal]; [but setImage:[UIImage imageNamed:@"radio-on.png"] forState:UIControlStateSelected]; [but setFrame:CGRectMake(0, 0, 44, 44)]; [but addTarget:self action:@selector(radioButton:)

Add Radio Button in Tableview Got Some Problem

你离开我真会死。 提交于 2020-01-01 12:21:06
问题 I know xcode don't have radio Button so I try to add a custom button and make it action like a radio button This is the image I use and this is the code I set to cell UIButton *but = [UIButton buttonWithType:UIButtonTypeCustom]; [but setImage:[UIImage imageNamed:@"radio-off.png"] forState:UIControlStateNormal]; [but setImage:[UIImage imageNamed:@"radio-on.png"] forState:UIControlStateSelected]; [but setFrame:CGRectMake(0, 0, 44, 44)]; [but addTarget:self action:@selector(radioButton:)