nib

Load custom UIView with XIB from a View Controller's view using IB

China☆狼群 提交于 2020-01-12 07:58:30
问题 I have a custom UIView ( MyCustomUIView ) which is built using Interface Builder. I'd like to place this custom view in MyViewController 's view, which is also designed using IB. I've placed an UIView as a subview in MyViewController 's XIB and set it's class to MyCustomUIView . The problem is, when I run the code, only a blank view appears. (When I instantiate MyCustomUIView in code, it displays well.) I'm only overriding the initWithFrame: method the following way in MyCustomUIView.m : -

load nibs in cocoa

孤街醉人 提交于 2020-01-11 06:35:35
问题 How can I load a nib inside of another window? I tried initWithWindowName, if (mmController == NULL) mmController = [[mainMenu alloc] initWithWindowNibName:@"mainMenu"]; [mmController showWindow:self]; but it opens a new window. I also tried loadNibNamed [NSBundle loadNibNamed:@"mainGame" owner:self]; and it succeeded, but when I try to use the same method to get back to the main menu, [NSBundle loadNibNamed:@"mainMenu" owner:self]; it doesn't work. It does nothing at all... Any ideas? 回答1: I

how to add a ready-to-use project ( created and started with application delegate but without xib,nib) to another project

此生再无相见时 提交于 2020-01-05 08:49:50
问题 I have a ready-to-use project ( created and started with application delegate but without xib,nib). Now I want to invoke and start it from another project. But I can't use initwithnib, how can I include and start this ready-to-use project from another project? More specifically, how to add and integrate Apple's Sample code " TableViewUpdates ( TVAnimationsGestures.xcodeproject ) " which only has its own appDelegate and Mainwindow.xib file to my own application? thanks! Or can you add a xib

How do I add custom UIButton to nib file in XCode?

本小妞迷上赌 提交于 2020-01-05 05:57:17
问题 I've just begin delving in to the world of iOS development. I am also a newbie to XCode. I've built several little test apps nows using the default UIComponents available by dragging and dropping them from the Objects library on to my .xib file and hooking up outlets and actions just to see how it all works. I wanted to take it to the next step and create my own custom painted button. I have a class named CustomButton that extends UIButton and I can programmatically add it to a view, but I

Xcode 5 Cocoa App Fails to Load Nib on OS X 10.6

亡梦爱人 提交于 2020-01-05 04:18:08
问题 I'm creating a Cocoa application for 10.6 and newer OSs. I created a brand new document-based application in Xcode 5 (10.9) and changed two settings to make it 10.6-compatible: I changed the deployment target to 10.6 and turned Auto Layout off on both MainMenu.xib and xxDocument.xib, the two default nibs that are included with the document-based template. I archived my application (no code signing) adding no other code and tested it on four different OSs. Here are the results: OS X 10.9:

Using nibs and storyboards together

北战南征 提交于 2020-01-05 04:02:57
问题 From what I have read on the internet, nibs and storyboards are comparable with each other in the same project. Now I am creating a tabbed application and would like to do the following: Tab 1: constructed with nibs, Tab 2: constructed with storyboards, Tab 3: constructed with nibs Initially I created everything with nibs so in my delegate I was passing from one tab to the next with this code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *

About supporting iPhone 5 when using nib files and backwards compatibility

送分小仙女□ 提交于 2020-01-03 06:33:12
问题 I've been looking for Apple's documentation and posts regarding this issue, but I didn't make it clear how should I deal with this, since most of information I found is about storyboards and autolayout feature. I'm using nib files instead of storyboards, and in addition I need to support iOS 5+, so I can't use autolayout. I'm using Xcode 4.6.3 and I've observed that, in IB, going to the view's Attributes inspector > Simulated Metrics, you can choose its size ("Retina 3.5 Full Screen", "Retina

Is it possible to hide the dock icon programmatically

喜夏-厌秋 提交于 2020-01-02 06:35:13
问题 Is it possible to hide dock icon programmatically on demand. I know one way by which defining property "Application is agent (UIElement)" in plist we make the cocoa app as user agent. But this result in hiding the dock icon permanently. I am looking for a way where i can control visibility of dock icon. Any idea ? 回答1: Unfortunately not. You can transform a background-only app to a foreground app using the TransformProcessType() function but you can't go from a foreground app to a background

iOS : How to build a bi-language iOS native application [closed]

心不动则不痛 提交于 2020-01-02 06:06:37
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . My customer want the iOS application that should have Bi-language(Arabic & English) support inside the application.I thought Localization will workout for this.But the design layout is different for arabic(RTL).How can i achieve this? Should design separate Nib file for both

How does loadNibNamed?

梦想的初衷 提交于 2020-01-02 04:51:10
问题 In most of the samples the return value from loadNibNamed value is not used, so I guess it's using the owner argument. But how does it work and make the connection to the owner object? What kind of requirements should my owner class meet in order to load a nib in such way? The only requirements I can guess is that the owner class must have an outlet defined on or many of the objects in the nib file the nib file's owner SHOULD be set to the class where the nib is being loaded, then the owner