xcode4.5

static unordered_map is erased when putting into different compilation unit in XCode

こ雲淡風輕ζ 提交于 2019-12-20 03:53:06
问题 I have a static unordered_map in my class C. I experience difference in behaviour if I put my class definition and declaration in different files from the file containing function main. The thing is that I observed that if the class C is in the same compilation unit as function main, all is well, I see only once the text "new string created: c". However if I split my code into three files (see the listing below), I see "new string created: c" twice which means that my static unordered_map is

objective c class method returned value, assigned to weak/strong properties

≯℡__Kan透↙ 提交于 2019-12-19 09:46:51
问题 I'm facing a bit of a confusion involving weak and strong properties. For the sake of brevity I won't include the entire code. I created a class convenience method which returns a UIView object, and I implemented it in a UIView category as an alternative to subclassing. @implementation UIView (CSMonthView) + (UIView *)monthViewFromDateArray:(NSArray *)arrayOfAllShiftsAndEvents withNibOwner:(id)owner selectedDate:(NSDate *)selectedDate withCompletionHandler:(void(^)(CSCalendarButton

Latest Clang location in XCode 4.5

こ雲淡風輕ζ 提交于 2019-12-19 04:15:24
问题 I've updated XCode to 4.5 (with iOS 6) and installed latest command line tools. Before that i always had the latest Clang version in /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin (clang and clang++ binaries), but now, with the last update, they are gone and i only have gcc and llvm stuff. I've checked 'clang' bins all over my Mac and found one in /Applications/XCode.app/Contents/Developer/Toolchains/XCodeDefault.xctoolchain/usr/bin But why so? First,

iOS 6 landscape and portrait orientation

爷,独闯天下 提交于 2019-12-19 03:42:18
问题 I have a table with a big list of stuff that comes from a plist file and clicking each of them takes you to a new view, a xib. I have 2 views inside that .xib, one for portrait and one for landscape In my h file I have this: IBOutlet UIView *portraitView; IBOutlet UIView *landscapeView; @property (nonatomic, retain) IBOutlet UIView *portraitView; @property (nonatomic, retain) IBOutlet UIView *landscapeView; In my m file this: [super viewDidLoad]; // Do any additional setup after loading the

Capture screen with CGDisplayStream

不羁岁月 提交于 2019-12-19 03:19:25
问题 I'm trying to implement a feature in my app that will record the screen. I have bits of code that I have found in some sample code and a WWDC 2012 video. So far I have this. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Get a list of displays. Copied from working apple source code. [self getDisplayList]; DisplayRegistrationCallBackSuccessful = NO; // Register the event for modifying displays. CGError err = CGDisplayRegisterReconfigurationCallback

Xcode Storyboard displaying the new iPhone 5 screen size?

白昼怎懂夜的黑 提交于 2019-12-18 12:46:46
问题 I have the latest version of Xcode. In one of my projects I noticed that the views for the iPhone were the new iPhone 5 screen sizes. I like it but is there a way to switch back to the smaller screen size? Not everyone has the iPhone 5. 回答1: Also, when your building your interface, you'll see a small icon that lets you quickly switch between 4" and 3.5" screens. It's the rectangular icon on the left. It toggles back and forth between phone sizes. 回答2: There's a size property in the attributes

Cannot delete derived data in Xcode 4's organizer

本秂侑毒 提交于 2019-12-18 07:28:11
问题 I'm trying to restore Code Sense, which has stopped working for my project, and it looks like the accepted way to do that is to delete the derived data. The problem is that the project has to be open or it doesn't appear in the Organizer, and the delete button for the derived data is faded out and unable to be clicked. My project is a dropbox folder. 回答1: You can clear Derived Data manually without using Organizer . Go to ~/Library/Developer/Xcode/DerivedData/ and delete every thing there, or

Stepping through the code is stopping on STL code when debugging c++ with Xcode 4.5

别来无恙 提交于 2019-12-18 06:17:31
问题 I try to debug c++ code with Xcode 4.5, compiled with llvm 4.1. The code is very simple, just inserting several items to a map. When I step over STL functions, the execution stops inside STL code, instead of performing the step as usual. When I compile using LLVM-GCC 4.2 the debug is just fine, but this compiler doesn't have C++11 support. Did anyone encounter this problem before, and knows if it can be fixed? 回答1: I can certainly experience the same issue since LLDB was introduced into Xcode

Xcode now generates an empty category. Why?

倾然丶 夕夏残阳落幕 提交于 2019-12-18 05:59:13
问题 I noticed this while using iOS6 beta 3 When I create a new subclass of a UIViewContoller (no other parent classes generate this behavior that I've noticed), the .m file now has an empty category at the top of the file. In the past when learning about categories I noticed that some people would use this same technique to indicate private methods (although not truly private). Is that what the intent is here? Has there been any change to making things actually private now? I notice the @private

UIPickerView can't autoselect last row when compiled under Xcode 4.5.2 & iOS 6

不羁的心 提交于 2019-12-18 03:53:43
问题 I have been beating my head against the wall trying to diagnose my app's inability to automatically preselect the last row of a UIPickerView using code that successfully worked under older versions of XCode. I think this is a bug in Xcode rather than iOS 6 because my old app running on an iOS 6 device works properly, but recompiling the code under Xcode 4.5.2 does not behave properly. I have put together the following sample to demonstrate the problem, but before I submit a bug report, I