English 中文(简体)
如何储存参考资料,然后使用外部的安保数据集?
原标题:how to store a reference to, and then use extern NSString const?

i ve将一个标本作为字典,每个字标注/code>,即希望以后使用的财产。

these dictionaries are key/value NSStrings like this: kABEmailProperty/email.

i 能够利用未包装的一览表从特定<代码>ABRecord中收集价值,列举未包装的列表词典(记录中的数字为ABRecord):

__block NSMutableArray *valueGroup = [[NSMutableArray alloc] init];

[self.propsDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
        NSString *valueString = [inRecord valueForProperty:key];
        if (valueString) { 
            NSDictionary *dict = [NSDictionary dictionaryWithObject:valueString forKey:obj];
            [valueGroup addObject:dict];    
                }
            }
        }];

如何适当提及key,以便成为。 ABRecord global property reference in ABGlobals.h und astring 储存在清单中?

i ve Trial using &key, and (id)key, and (ave *), but i m really only flailing around.

i 在寻找有关使用全球实习生的各种问题方面,我没有成功,尽管这个问题已经很丰富。

最佳回答

如果我正确理解你的话,你会说:

NSString *foo = "kABEmailProperty";

你们希望能够这样做:

[inRecord ValueForProperty:kABEmailProperty];

根据 f的价值。 更正? 无法直接做到这一点,因为“kABEmailProperty”的名称(易于)在操作时可以查阅;它只是一个汇编时的名称。

我的建议是,用其中所有关键因素做一个词典;例如:

<代码>NSDtionary *keys = [NSDictionary dictionary] WithObjectsAndKeys:kABEmailProperty, @“kABEmailProperty”, kAB OtherProperty, @“kAB OtherProperty”, ..., nil

因此,你可以做这样的事情:

[inRecord valueForProperty:[keys objectForKey:foo]];

i.e. 绘制<代码>@”kABEmailProperty>至k ABEmailProperty 实际上已有。

问题回答

暂无回答




相关问题
Taking picture with QTCaptureView

Is it possible to simply take a picture and save it somewhere using a QTCaptureView and Apple s built-in iSight? I ve seen lots of tutorials on recording video but none on simply taking a picture. Any ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

How to get a flash url in a webpage using a webframe?

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit informal protocol(WebFrameLoadDelegate): webView:didStartProvisionalLoadForFrame: webView:...

热门标签