检测到iPhoneNumbers已被弃用?
问题描述:
我收到一条警告,指出已检测到iPhoneNumbers已被弃用。 任何帮助请..检测到iPhoneNumbers已被弃用?
textScrollView.detectsPhoneNumbers = NO;
答
从documentation摘自:
中的iOS 3.0已过时。改为使用 dataDetectorTypes。
Defines the types of information that can be detected in text-based content.
enum {
UIDataDetectorTypePhoneNumber = 1 << 0,
UIDataDetectorTypeLink = 1 << 1,
UIDataDetectorTypeAddress = 1 << 2,
UIDataDetectorTypeCalendarEvent = 1 << 3,
UIDataDetectorTypeNone = 0,
UIDataDetectorTypeAll = NSUIntegerMax
};
我不想听起来像一个刺。但是,你真的应该能够自己找到这个。您只需在developer.apple.com上搜索“检测到的电话号码”,您就可以在更短的时间内找到答案,而不会让您发布问题。稍微夸张,但你得到我的漂移。 – 2010-11-18 09:48:29
@ Yannick..sorry我应该做到这一点......反正TNN ... – 2010-11-18 10:50:49
再次,不是一个混蛋,但你已经问过其他两个不赞成使用的方法:http://stackoverflow.com/questions/4206848/setfont-depricated,http://stackoverflow.com/questions/4107392/setallowsimageediting-is-deprecated和两个替换都可以很容易地在文档中找到。下一次遇到这种情况时,请搜索该方法并在文档的标题下查找。苹果通常会告诉你应该使用什么而不是这种方法,他们认为它已被弃用。 – 2010-11-18 15:53:33