xcode4.2

Take ScreenShot without Window

风流意气都作罢 提交于 2019-12-23 17:25:39
问题 I've been studying Son Of Grab Apple demo and I'm really struggling to get a screenshot of screen without any window (only desktop, dock and menu bar). Does anyone knows how to do so? 回答1: Here's some example code which takes a screenshot with just the desktop. CFArrayRef onScreenWindows = CGWindowListCreate(kCGWindowListOptionOnScreenOnly, kCGNullWindowID); CFArrayRef nonDesktopElements = CGWindowListCreate(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements,

How to dismiss popovers in iOS 5?

烈酒焚心 提交于 2019-12-23 14:03:44
问题 I have a PatientTableViewController in the master side of the iPad that has a button for Adding a new patient. It transitions to this NewPatientViewController via a popover segue . In the NewPatientViewController I have a Done button that delegates back to the PatientTableViewController : - (void)newPatientViewController:(NewPatientViewController *)sender withZipCode:(NSNumber *)zipCode andFirstName:(NSString *)firstName andLastName:(NSString *)lastName { [self dismissViewControllerAnimated

Facebook iOS SDK Feed Dialog issue after authentication

こ雲淡風輕ζ 提交于 2019-12-23 10:54:13
问题 I seem to be having an issue with the feed dialog, which I haven't had before. I suspect it's because of iOS 5, but I'm not sure. If the user needs authentication, he's being redirected to the Facebook app, and then returns to my app. Afterwards, the user clicks a "Share" button, and the feed dialog appears . But suddenly, it disappears . If the user clicks "Share" again, the feed dialog is working just fine. It's just that first time, after returning to the app from authentication... The

Hide UITableView when searchResultsTableView displayed

匆匆过客 提交于 2019-12-23 09:41:20
问题 I have a UITableView with a searchDisplayController implemented. I have tableView.backgroundColor = [UIColor clearColor]; and self.searchDisplayController.searchResultsTableview.backgroundColor = [UIColor clearColor]; When I enter text in the search field, the search results are displaying fine, but as the background of the resultant table is transparent, I am seeing my tableview and on the tableview the search result table is displayed. I want to hide the tableView when the searchField began

Implementing object mapping using RestKit in Objective-C

怎甘沉沦 提交于 2019-12-23 05:26:20
问题 I am having trouble mapping a JSON response to objects using RestKit and Objective-C. I have already set up my RKObjectManager and mappings in my AppDelegate as suggested in my previous post by mja. I call my backend in my controller as per the example below. There are two issues I'm having trouble with: [[RKObjectManager sharedManager] postObject:request mapResponseWith:responseMapping delegate:self]; } <-- This results in a "self" is incompatible with type id. What do I need to send to this

Building Ruby 1.9.3 on Lion with Xcode 4.2 using ./configure --with-gcc=clang

元气小坏坏 提交于 2019-12-23 05:19:08
问题 My environment: Mac OS X v10.7.2 with Xcode 4.2.1 I am trying to build ruby 1.9.3 on Lion with Xcode 4.2.1. I understand there's an issue with the llvm-based gcc compiler that comes with Xcode 4.2.1. But I'm trying to work around it by following these instructions, http://goo.gl/Sc39g. I was able to get a little farther along, but then ran into these 2 problems: #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags! fatal error: 'sys/statfs.h' file not found The complete configure

TabBarController, overwriting shouldSelectViewController to do a segue

为君一笑 提交于 2019-12-23 04:33:48
问题 Hi Im trying to change the tabcontroller flow, so when a user is not loged in just take him to the login view instead the settings one. My controller extends TabBarController and I set the delegate as self.tabBarController.delegate=self; My Code is: - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { if (login) { LoginViewController *loginViewController = [[LoginViewController alloc] init]; UINavigationController

From XCode 4.2 to 4.3, new ViewController class .m files are defined differently. Why?

眉间皱痕 提交于 2019-12-23 03:55:06
问题 Like most, I recently downloaded the latest version of XCode (4.3.1). I've noticed that as I'm creating new UIViewController objects, the associated .m files contain additional class definition code that I haven't ever seen before. Specifically, if I create a new UIViewController named 'TestViewController', I get the following .m file output. \\... removed comments... #import "TestViewController.h" @interface TestViewController () @end @implementation TestViewController - (id)initWithNibName:

XCode 4.2: Renamed project file in project navigator, all project settings/config lost

半腔热情 提交于 2019-12-22 17:49:28
问题 I'm panicking a bit here... In the project navigator, I clicked and renamed my .xcodeproj file (thinking it was the way to rename the project). What has happened is that all the settings and files for the project have disappeared from the project navigator, and i'm left with a blank project! Checking in Finder, it's removed my old .xcodeproj file, created a new one with the name I gave it - but on inspection, the file is empty! nothing inside. I fear I may have lost all the settings in there.

Mac OS X Lion 10.7.2 Xcode 4.2 memory issues

北慕城南 提交于 2019-12-22 13:31:33
问题 I've got MacBook Pro 2011, 15" i7 2GHz 8GB Ram 1333 MHz OS X Lion 10.7.2 all updates installed released to this date. I have done everything what I can to minimize RAM consumpsion and the only problem I've got at this point is when I run Xcode. I had 4gigs of RAM, than bought 8 gigs and always 've got 10-30 MB of free memory after 3-5 minutes of Xcode running and PAGE INS are 300MB - 700MB. I tried to switch to 32-bit running mode but no change. Can anybody help me please? 回答1: Yes. One way