cocoa

UILabel subclass

ε祈祈猫儿з 提交于 2020-01-03 06:33:08
问题 I know that this is a newbie question but I am a newbie so here goes: I wish to use Chalkduster font quite a lot throughout my app (buttons, labels etc) and have tried subclassing UILabel to achieve this. I have the following in Default.h: #import <UIKit/UIKit.h> @interface Default : UILabel { UILabel *theLabel; } @property (nonatomic, strong) IBOutlet UILabel *theLabel; @end and this in my .m: #import "Default.h" @implementation Default - (id)initWithFrame:(CGRect)frame { self = [super

Shared CoreData between apps

夙愿已清 提交于 2020-01-03 06:19:32
问题 My question somewhat similar to How to have multiple apps - one Core Data?. But I am not unable to replicate as suggested in the answer. I have two applications. One applications (1st App) allows user to do all sort of things and save in coredata. Other application (2nd App) is a service application. Here I want the service to get notified everytime the coredata is updated(any changes like create, delete, update done). If I use following notification in 2nd App, this notification does not get

MMDrawerController unrecognized selector

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 06:16:48
问题 I'm trying to setup a siderbar navigation menu for my app. I'm using the MMDrawerController lib, but I'm running into an issue. I've added a button and use these methods to call the sidebar: -(void)setupLeftMenuButton{ MMDrawerBarButtonItem * leftDrawerButton = [[MMDrawerBarButtonItem alloc] initWithTarget:self action:@selector(leftDrawerButtonPress:)]; [self.navigationItem setLeftBarButtonItem:leftDrawerButton animated:YES]; } -(void)leftDrawerButtonPress:(id)sender{ [self.mm

inserting various views into UIScrollView

北慕城南 提交于 2020-01-03 06:08:02
问题 we're trying to implement an article detail view for an RSS-like application. The windows has a UIScrollView that contains a UITextView (which is the title), a UIButton (which opens a gallery), and a UIWebView (with the body). The idea is that all these elements scroll together... The problem is that whenever we have a body over 1000px tall, everything below that mark is truncated. We've heard that this is because that is the maximum height for a view, and since the Scroll is handled by the

inserting various views into UIScrollView

不羁的心 提交于 2020-01-03 06:07:22
问题 we're trying to implement an article detail view for an RSS-like application. The windows has a UIScrollView that contains a UITextView (which is the title), a UIButton (which opens a gallery), and a UIWebView (with the body). The idea is that all these elements scroll together... The problem is that whenever we have a body over 1000px tall, everything below that mark is truncated. We've heard that this is because that is the maximum height for a view, and since the Scroll is handled by the

Getting keyboard state using GetKeys function

蓝咒 提交于 2020-01-03 05:20:33
问题 Does anyone know how to get any key state (pressed or no) by GetKeys function? In other words how to handle this function: bool result = isPressed(kVK_LeftArrow); Thankyou. 回答1: The KeyMap type is an array of integers but its real layout is a series of bits, one per key code. The bit number for a particular key is one less than the virtual key code. Since bit-shifting isn't legal for very large values (e.g. you can't just ask the compiler to shift 74 bits), the KeyMap type is broken into 4

Core data - how to get records from an entity and add them to another entity

谁说胖子不能爱 提交于 2020-01-03 05:18:06
问题 I have two entities: TempProducts and Products TempProducts is populated in TableView. The user must enter the data in the tableview.Than when he clicks on a button i need to get all records from TempProducts and add them to Products.After that i delete all TempProducts in order the table to be empty for next time. - (IBAction)saveData:(id)sender { //FETCH ALL RECORDS OF TEMPPRODUCTS NSFetchRequest * allTempProducts = [[NSFetchRequest alloc] init]; [allTempProducts setEntity:

Listen to events from programatically created NSView

微笑、不失礼 提交于 2020-01-03 05:11:06
问题 I have created a sidebar inside my C#/MonoMac application using an NSOutlineView and got help creating the items in the question Create NSView programatically in Xamarin Studio. But now I have made some items in the outline view editable and of course I want to detect when the items are edited and take action (edit the underlying model, or create a new one if a special "Create new" item was edited). The items can be edited alright, either by double click or pressing Return when it's selected.

Cocoa Socket Programming NSInputStream read returns 0

拟墨画扇 提交于 2020-01-03 04:45:13
问题 In my App, have setup the stream like this, (void)connectStream:(NSString *)pHostName PortNo:(int)inPortNo HasInput:(bool)bInput HasOutput:(bool)bOutput{ NSHost *host = [NSHost hostWithName:pHostName]; //host = [NSHost hostWithAddress:pHostName]; [NSStream getStreamsToHost:host port:inPortNo inputStream:&pInputStream outputStream:&pOutputStream]; [pInputStream retain]; [pOutputStream retain]; [pInputStream setDelegate:self]; [pOutputStream setDelegate:self]; bool bUseSSL = YES; if (bUseSSL) {

How to add Private Frameworks into Project?

耗尽温柔 提交于 2020-01-03 04:23:24
问题 I have a framework that's part of my app and I want to add it as a private framework so I can distribute it. However, I couldn't find a way how to do it. Apple does provide steps on how you should add private frameworks, but they're too brief to follow. If anyone can point my to the right way on how to do this, I'd be really glad. Thanks. 回答1: Apple already provided steps for Embedding a Private Framework in Your Application Bundle. You should read this document. 来源: https://stackoverflow.com