xcode4.2

Xcode 4.2 - UILabel Word Wrap

血红的双手。 提交于 2019-12-06 04:03:01
问题 I know people have asked this question a bunch of times alrdy on Stack, but the usual answer of changing "Lines: 0" and selecting "Line Breaks: Word Wrap" just isn't fixing it for me. I am using Xcode 4.2 with a Storyboard. I have placed a UILabel on a View Controller and resized it to cover most of the View. I have changed "Lines" value to 0 and "Line Breaks" value to Word Wrap. I have tried \n in my string: @"This is my label text \n that's supposed to wrap." Any ideas?? EDIT: I wasn't

Xcode has started making archives, not apps. How do I change it back?

为君一笑 提交于 2019-12-06 02:16:39
问题 Im' writing an phone app in Xcode 4.2. At some point in the last few days, I changed something - I don't know what, and there's nothing obvious in the git history - and although I can still run it on my device and in the simulator, when I archive the build it makes an archive instead of an app. I can't share these archives as IPA files; if I try I get told "No packager exists for this type of archive". What did I do? How do I change it back so I can produce IPAs again? 回答1: Make sure for any

Valid Distribution profiles vanish from the Xcode Organizer?

别等时光非礼了梦想. 提交于 2019-12-05 20:38:17
问题 Since 2 weeks ago, every time I manually add any Distribution Profiles (Ad-Hoc or AppStore Profiles) to Xcode, they vanish from the Organizer in a matter of minutes, or when I press the Refresh button (the one next to "Automatic Device Provisioning" in Organizer). How do I solve this problem? (note that I've already tried to start fresh without success: cleaning KeyChain Access, revoking certificates, deleting profiles, and do it all step by step since the beginning) 回答1: If you're not logged

__weak and autorelease pool in ARC in Xcode 4.2

与世无争的帅哥 提交于 2019-12-05 18:39:24
My project use ARC. I tested with the code below: NSString __weak *string; @autoreleasepool { string = [NSString stringWithString:@"AAA"]; } NSLog(@"string: %@", string); I think it output as: string: (null) but it actually output: string: AAA I don't understand it. What is the effect of __weak? EDIT: And this code below: NSString __weak *string; NSString __strong *str; @autoreleasepool { str = [NSString stringWithFormat:@"%@", @"AAA" ]; string = str; } NSLog(@"string: %@", string); It also output as: string: AAA NSString __weak *string; @autoreleasepool { string = [NSString stringWithFormat:@

Display StopWatch Timer animated like the petrol pump meter using NSTimer

对着背影说爱祢 提交于 2019-12-05 18:32:43
I am new in iOS developement.When I press the stopwatch start button I want to display the timer like counter token effect.I have attached image for your reference.I have done to display secs and minutes but I dont know, How animate autoscroll effect? How can I do this? When the counter is moving it shouldn't jump from one number to another number, instead it should move from one number to next number smoothly, just like the petrol pump meter. Thanks You need to manually scroll tableView instead of scrollToRowAtIndexPath because this animation uses its own timer interval and its very difficult

How to add a .sql file to sqlite db in Xcode [duplicate]

寵の児 提交于 2019-12-05 16:58:20
This question already has answers here : How should I specify the path for an sqlite db in an iPhone project? (3 answers) Closed 6 years ago . I am writing a offline iPhone app in which I need to read and display from a database which consists of a few number of tables. The tables have over 100k entries in it, so it is almost impossible to enter it all individually. I have downloaded the .sql file of the entire db. Now how can I import the db as such into sqlite/Xcode so that I can readily start accessing the data in it?? Edit: I have seen that when using a database, the file extension that is

How to establish secondary NSSortDescriptor sort key?

自作多情 提交于 2019-12-05 16:33:40
问题 I have successfully sorted the data I have by my sort key lastName , but I want to know how to sort by lastName , and then by firstName . Here is the code I used to sort by lastName NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"firstName" ascending:YES]; [request setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]]; How do I add the secondary sort key of firstName ? 回答1: NSSortDescriptor *sortDescriptor1 = [[NSSortDescriptor alloc] initWithKey:@"firstName"

Unknown type name 'namespace' in xCode 4.2?

萝らか妹 提交于 2019-12-05 14:50:48
问题 I am compiling QCAR SDK, but it prompts an error after I added more frameworks to the project. // Matrices.h // #ifndef _QCAR_MATRIX_H_ #define _QCAR_MATRIX_H_ namespace QCAR { /// Matrix with 3 rows and 4 columns of float items struct Matrix34F { float data[3*4]; ///< Array of matrix items }; /// Matrix with 4 rows and 4 columns of float items struct Matrix44F { float data[4*4]; ///< Array of matrix items }; } // namespace QCAR #endif //_QCAR_MATRIX_H_ In the line namespace QCAR , it said

Xcode 4 target build setting “Skip install”. What is it?

…衆ロ難τιáo~ 提交于 2019-12-05 11:10:29
问题 The tile basically says it all. I'm developing a mac app which has the normal app target, but also has two more command-line tool targets whose products are copied to the app when building. I remember seeing somewhere that the "Skip install" was important in these cases, but I remember nothing of what I read, so this might be incorrect. Anyway, I just wanted to know what this option affects. 回答1: I believe this only matters when you're developing for the App Store. If you archive your app

NSToolbar: how do I initialise with a selected item?

我怕爱的太早我们不能终老 提交于 2019-12-05 10:34:40
I have a Mac OS application with a preferences window with a NSToolbar on it. I have also a custom subview under it and other 3 custom views that are loaded inside the first one when the user clicks on one of the options. So far, so good. Now I realised the first item is not selected by default when the window is loaded. I see no options in the inspectors, except the "selectable", which I used. But there is no "selected". Should I do it programmatically? How? NSToolbar has a -setSelectedItemIdentifier: method that you can use in your -windowDidLoad method. 来源: https://stackoverflow.com