小编Cho*_*gzl的帖子

SQLITE_TRANSIENT在Swift中未定义

我正在使用xcode 6,我已导入libsqlite3.dyliblibsqlite3.0.dylib.我还添加了Bridging-Header.h文件女巫导入sqlite3.h

我可以打开SQLite数据库并执行简单的操作,如插入选择...

if (sqlite3_bind_text(compiledStatement, 2, Name.cStringUsingEncoding(NSUTF8StringEncoding), -1, SQLITE_TRANSIENT) != SQLITE_OK)

我有一个错误: Use of unresolved identifier 'SQLITE_TRANSIENT'

我做什么节目?我是斯威夫特的新手,这是我在Stack上的第一个问题,请有人帮助我!

sqlite xcode swift

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

更改地图标注swift的标题字体

我想知道是否有任何方法可以在不创建自定义视图的情况下更改标题字体?像这样的东西:

annotation.title.font = UIFont.systemFontOfSize(12.0)
Run Code Online (Sandbox Code Playgroud)

我四处搜索,每个人都说我必须创建一个像本教程一样的自定义视图,但它是如此复杂,它在Objective-c中.

希望有人有一个简单的方法来改变字体.

谢谢.

font-size mkannotationview swift

6
推荐指数
0
解决办法
1726
查看次数

在sqlite Swift中将数组作为参数传递

我通过#import <sqlite3.h>在我的header.h文件和libsqlite3.dylib.

如何将数组作为参数传递给我的查询,这是我的想法:

var arrayId = [1,2] // array with interested Id 
var query:NSString = "Select id from Product where id IN \(arrayId)" // I want to select Products with id that are in the array
Run Code Online (Sandbox Code Playgroud)

编辑:如果 arrayId 是,它会改变NSArray吗?因为我还需要 arrayId 作为 NSArray。

然后我继续打开sqlite数据库,准备查询等等。

先感谢您。

sqlite swift

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

在swift中读取blob数据额外参数字节

我试图从sqlite读取blob数据,但我收到Extra argument 'bytes' in call错误.

这是我的代码:

var len = sqlite3_column_bytes(compiledStatement, 0)
var point = sqlite3_column_blob(compiledStatement, 0)
var dbData:NSData? = NSData(bytes: point, length: len)// ERROR: Extra argument 'bytes' in call

if dbData != nil
{
   arrDataRow.addObject(dbData!)
}
Run Code Online (Sandbox Code Playgroud)

sqlite blob nsdata swift

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

在swift中取消选择时,setTitleTextAttributes对UITabBarItem不起作用

我想定制我的UITabBarController.我把它嵌入到我的中UIViewController,我也为此创建了一个类UITabBarController.

override func viewDidLoad() {
    super.viewDidLoad()

    //custom tab bar
    self.tabBar.barTintColor = UIColor(red: 0.0/255.0, green: 102.0/255.0, blue: 153.0/255.0, alpha: 1)
    self.tabBar.tintColor = UIColor(red: 171.0/255.0, green: 203.0/255.0, blue: 61.0/255.0, alpha: 1)
    self.tabBarItem.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.whiteColor()], forState:UIControlState.Normal)
    self.tabBarItem.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.whiteColor()], forState:UIControlState.Disabled)

    for item in self.tabBar.items as [UITabBarItem]
    {
        item.image = item.selectedImage.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
    }


    // Do any additional setup after loading the view.
}
Run Code Online (Sandbox Code Playgroud)

setTitleTextAttributes对标签栏项目没有任何影响.有人可以帮我找出错误的位置吗?

uitabbaritem ios swift

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

标签 统计

swift ×5

sqlite ×3

blob ×1

font-size ×1

ios ×1

mkannotationview ×1

nsdata ×1

uitabbaritem ×1

xcode ×1