小编Cyp*_*ian的帖子

静态库具有相同的函数名称,导致重复符号错误

我在我的iPad应用程序中使用了2个第三方库.我不知道这些库的源代码.这些库在两者中都具有相同名称的函数.因为功能名称中的冲突,我得到"Apple Mach - O(id)错误".我无法更改其中的函数名称,因为源代码未知.在构建应用程序时,错误正在发生.

该错误表明:

ld:/ Users/Desktop/untitled文件夹/ Universal/lib/simulator/myLib.a(mem.o)和/ Users/Library/Developer/Xcode/DerivedData/iOS-aqpprpcivvjjadbsutqqmtjsoczk/Build/Intermediates/ios中的重复符号_T_strcpy. build/Debug-iphonesimulator/myApp iPad.build/Objects-normal/i386/pdcrypte2.o for architecture i386 collect2:ld返回1退出状态命令/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-g++- 4.2退出代码1失败

谁能分享一些建议?

iphone objective-c ipad xcode4

3
推荐指数
1
解决办法
5231
查看次数

启用静态库中使用的ifdef宏

你能使用静态库中定义的宏吗?

我有自己的调试宏TWDEBUG,我在一个我创建用于共享的静态库中使用.如果我将静态库导入到我的新项目并使用它,编译器似乎无法识别它.我确实将预处理器宏设置为TWDEBUGand Other C flags和Other C++ flagsto -TWDEBUG,但是当我运行代码时,ifdef宏不会被执行.

macros objective-c conditional-compilation ios

2
推荐指数
1
解决办法
1986
查看次数

CBCentralManager scanForPeripheralsWithServices:nil没有返回任何结果

我正在尝试显示所有可用的BLE信标.我有一些Estimote和Kontakt.io信标,由于某种原因,下面的BLE扫描代码找不到任何一个.

我经历了与BLE发现有关的所有可能的SO问题,并且代码与其他地方完全一样.

应用源代码在这里

- (void)viewDidLoad {
    [super viewDidLoad];

     self.manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
}


/*
 Request CBCentralManager to scan for all available services
 */
- (void) startScan
{
    NSLog(@"Start scanning");

    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber  numberWithBool:YES], CBCentralManagerScanOptionAllowDuplicatesKey, nil];

    [self.manager scanForPeripheralsWithServices:nil options:options];
}
Run Code Online (Sandbox Code Playgroud)

永远不会调用此委托方法

/*
 Invoked when the central discovers bt peripheral while scanning.
 */
- (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)aPeripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{

    NSLog(@"THIS NEVER GETS CALLED");

}
Run Code Online (Sandbox Code Playgroud)

bluetooth objective-c ios bluetooth-lowenergy

1
推荐指数
1
解决办法
6980
查看次数

如何检查字符串是否包含URL

我有短信,我想检查它是否包含文本"http"或URL存在.

我该如何检查?

iphone nsstring

0
推荐指数
1
解决办法
1455
查看次数

你传递给方法wait(int*)是什么

当我简单地传递int时,我收到警告:

警告:不兼容的整数到指针转换将int传递给int类型的参数

换句话说是什么 int *

c iphone ios

-3
推荐指数
2
解决办法
427
查看次数