Code Monkey home page Code Monkey logo

Comments (4)

CoderJackyHuang avatar CoderJackyHuang commented on September 23, 2024

原则上与本库没有关系的。只是格式化一下打印而已啊!调用db做了些什么?代码放出来看看!

原始邮件
发件人:[email protected]
收件人:CoderJackyHuang/[email protected]
发送时间:2016年5月31日(周二) 16:14
主题:[CoderJackyHuang/HYBUnicodeReadable] 新版1.2引入后会导致FMDB报错 (#6)

更新到1.2之后引起fmdb初始化错误,如果将库移除了fmdb初始化就正常了
错误日志:
2016-05-31 16:12:30.878 dituwuyou[661:200721] -DBModel init: /var/mobile/Containers/Data/Application/B95688FA-57B3-44DC-8148-750E39FDB8FC/Documents/dituwuyou.sqlite
2016-05-31 16:12:30.895 dituwuyou[661:200721] _path
2016-05-31 16:12:30.895 dituwuyou[661:200721] _queue
2016-05-31 16:12:30.895 dituwuyou[661:200721] _db
2016-05-31 16:12:30.895 dituwuyou[661:200721] -[FMDatabaseQueue db]: unrecognized selector sent to instance 0x12df5bcc0
2016-05-31 16:12:30.896 dituwuyou[661:200721] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FMDatabaseQueue db]: unrecognized selector sent to instance 0x12df5bcc0'
*** First throw call stack:
(0x18201adb0 0x18167ff80 0x182021c4c 0x18201ebec 0x181f1cc5c 0x1005c6a58 0x1828fe3cc 0x181fe455c 0x181fe2464 0x1828fe320 0x1828fe1f0 0x1004850d8 0x1004852e0 0x100484ddc 0x100371240 0x10036e7f4 0x10038e864 0x1871ee9c0 0x18741e184 0x1874225f0 0x18741f764 0x1839bb7ac 0x1839bb618 0x1839bb9c8 0x181fd109c 0x181fd0b30 0x181fce830 0x181ef8c50 0x1871e794c 0x1871e2088 0x1004014b8 0x181a968b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from hybunicodereadable.

coolwxb avatar coolwxb commented on September 23, 2024
NSString* docsdir = [NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *dbpath = [docsdir stringByAppendingPathComponent:@"dituwuyou.sqlite"];
FMDatabaseQueue* queue   =[FMDatabaseQueue databaseQueueWithPath:dbpath];
 [queue inTransaction:^(FMDatabase *db, BOOL *rollback){
.....
}

from hybunicodereadable.

coolwxb avatar coolwxb commented on September 23, 2024

到FMDB内部初始化就报错了

- (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags vfs:(NSString *)vfsName {

    self = [super init];

    if (self != nil) {

        _db = [[[self class] databaseClass] databaseWithPath:aPath];
        FMDBRetain(_db);

#if SQLITE_VERSION_NUMBER >= 3005000
        BOOL success = [_db openWithFlags:openFlags vfs:vfsName];
#else
        BOOL success = [_db open];
#endif
        if (!success) {
            NSLog(@"Could not create database queue for path %@", aPath);
            FMDBRelease(self);
            return 0x00;
        }

        _path = FMDBReturnRetained(aPath);

/*************这句崩溃了***************/
        _queue = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], NULL);
/******************************/
        dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL);
        _openFlags = openFlags;
    }

    return self;
}

from hybunicodereadable.

yuzhang2 avatar yuzhang2 commented on September 23, 2024

和self的description有关,如 NSLog(@"%@", self); 就会出错

from hybunicodereadable.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.