命名与Framework和类共享名称冲突

时间:2015-12-08 17:19:37

标签: ios xcode swift

我遇到的情况是SMTPserver = 'smtp.xxxx.com SMTPport = 587 sender = 'info@xxx.com' destination = ['testgmailid@gmail.com'] USERNAME = "info@xxxx.com" PASSWORD = "1234" text_subtype = 'plain' subject="Sent from Python" import sys import os import re from smtplib import SMTP from email.MIMEText import MIMEText try: msg = MIMEText(content, text_subtype) msg['Subject']= subject msg['From'] = sender conn = SMTP(SMTPserver,SMTPport) conn.set_debuglevel(True) conn.ehlo() conn.starttls() conn.login(USERNAME, PASSWORD) try: conn.sendmail(sender, destination, msg.as_string()) finally: conn.close() except Exception, exc: sys.exit( "mail failed; %s" % str(exc) ) # give a error message 包含以下类:DataManager.frameworkDataManagerLocationManager

我无法进行基于模块的调用,例如

RecordingManager

因为我遇到了let rec : DataManager.RecordingManager DataManager.framework

之间的命名冲突

除了重命名我的班级或框架之外,还有其他工作吗?

1 个答案:

答案 0 :(得分:0)

阿-HA!

所以我所做的就是将我的DataManager课程重命名为XDataManager

然后我创建了一个包级访问器:

public var sharedInstance { return XDataManager.sharedInstance }

这样,我仍然可以保留访问DataManager.sharedInstance的旧代码,同时能够区分包DataManager和类XDataManager