xcode4.5

Xcode 4.5 - OS X Cocoa Application - Basic Web View: Load Google when opened

不问归期 提交于 2019-12-06 07:36:04
问题 I'm trying to create an extremely basic OS X Cocoa Application that when opens loads http://www.google.com. As basic as possible (no back or forward buttons, etc.). I have little experience with Xcode 4.5 and I can't find any tutorials regarding a web view for OS X Cocoa Application AND Xcode 4.5. I was able to find a tutorial and create a web view for an iOS web view. I took what I learned but didn't get very far. Here's what I did so far: Created New OS X Cocoa Application in Xcode 4.5.2

Creating image with in the frame of a rectangle placed on a UIImageview

蓝咒 提交于 2019-12-06 06:08:37
How to create a new image with specified frame in a UIView, the view contains imageviews and buttons also.I also need to get the image in the specified frame as a new image. I've tried this but it not correct. I need to crop from UIView and make it as a new UIImage. You need to import this framework in your project. #import <QuartzCore/QuartzCore.h> And use following code [imageView.layer setBorderColor: [[UIColor blackColor] CGColor]]; [imageView.layer setBorderWidth: 2.0]; // set border width as per your requirement. EDITED: Use any one which you need. For Get Crop Image: UIImage *croppedImg

Dismiss Popover using Unwind Segue in Xcode Storyboard

倾然丶 夕夏残阳落幕 提交于 2019-12-06 05:54:28
问题 I am using Xcode 4.5 and the new iOS 6 feature to unwind segues. I am presenting a navigation view controller inside a popover which is presented programmatically from a bar button item: - (IBAction)configChartTapped:(id)sender { if (self.popover.isPopoverVisible) { [self.popover dismissPopoverAnimated:YES]; } else { UINavigationController *chartConfigNavigationController = [self.storyboard instantiateViewControllerWithIdentifier:@"GrowthChartNavigationController"];

How to specify NSLineBreakMode in boundingRectWithSize?

守給你的承諾、 提交于 2019-12-06 05:04:40
问题 [text boundingRectWithSize:BOLIVIASize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:FONT} context:nil]; That is the new replacement for - (CGSize) sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode) lineBreakMode However, how do I specify the lineBreakMode parameter on boundingRectWithSize? 回答1: use NSParagraphStyleAttributeName & NSParagraphStyle : NSMutableParagraphStyle *paragraph = [[NSMutableParagraphStyle alloc]

Change application/target name in xcode

ⅰ亾dé卋堺 提交于 2019-12-06 04:29:21
I want to develop same app (same coding ) but with different names .So gone for renaming the app.I tried changing varoius parameters like Bundle Name, Bundle Display Name, Product Name and clean the app and then build it. But build is succeeded .After fraction of second my I see the status Finished running 'appname' on iphone 6.0 simulator and my app stops running .What should I exactly change to rename my app ? Bundle Display Name and Bundle Identifier. The Bundle Display Name for the name that is displayed under the app icon on your device. The Bundle Identifier to make the device, simulator

Add image on UITextView with custom spacing and text

有些话、适合烂在心里 提交于 2019-12-06 03:38:42
问题 I want to add Image on text view and want proper spacing as shown in screenshot. I have tried to add image on textview but I m having problem in placing text as per requirement. Please provide me help regarding same. 回答1: In SWIFT: var exclusionPath:UIBezierPath = UIBezierPath(rect: CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height)) textView.textContainer.exclusionPaths = [exclusionPath] textView.addSubview(imageView) 回答2: Add the below code after defining textView and

How can I enable Xcode refactor options for an external build project?

人走茶凉 提交于 2019-12-05 23:33:16
I want to use XCode as an IDE for developing some AVR code. I did the following 1) create new project 2) select external build system 3) indicated i want it to be make, and told it NOT to "Pass build settings in environment" 4) copied my .c/ .h/Makefile into the same directory i created the project in 5) added the .c/ .h files to the project/target 6) verified that i can build (make) from both command line and Xcode But I cannot use any of the refactor menu options, or jump to/reveal options. There appears to be no symbol information. Is there no way to use Xcode as more than just a simple C

UIViewControllerHierarchyInconsistency worked in ios5 but not in ios6

▼魔方 西西 提交于 2019-12-05 16:13:47
I had a perfectly working project until i have updated to ios6. when i tab on a bar item to show a popover with a view the app crashes... here is the error i'm getting "reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0xaa7d730; frame = (20 0; 748 1024); autoresize = RM+BM; layer = <CALayer: 0xaa7d790>> is associated with <TYOFormViewController: 0xaa7d8b0>. Clear this association before associating this view with <TYOFormViewController: 0x14c68a70>.'" and here is the method that declares the UIViewController and the UIPopoverController. -

Adding Label on Application Window from app delegate

不想你离开。 提交于 2019-12-05 14:39:55
I am using Xcode 4.5 and iOS 6.0, I have selected the default single view template from the xcode, I just want to add the label on the application window but I am unable to do so. Please correct me. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; self.window.rootViewController = self.viewController;

How to set the Identifier of a UIView in Xcode/iOS for debugging auto layout?

强颜欢笑 提交于 2019-12-05 11:59:45
问题 During a talk from WWDC 2012 (Best Practices for Mastering Auto Layout), the presenter said that you can set a UIView identifier in Xcode to aid in debugging auto layout: This seems like a really good idea, but in Xcode 4.5.1 for my iOS project, there is no way that I can see to set the Identity of a UIView. How can I set the Identity of a UIView in Xcode 4.5.1? If this isn't possible in iOS projects, how can I get the same functionality? 回答1: Setting accessibilityIdentifier on UIView does