I cannot seem to declare my imageView as PFImageView.
Keeps saying Use of undeclared type 'PFImageView'
In storyboard, I changed the class to PFImageView
I have imported the frameworks in the bridge file
One suggestion on the Parse forum says to do this, but not sure how to with swift:
//In AppDelegate / applicationDidLaunch add:
[PFImageView class];
Update:
After searching through the parse framework, I don't actually PFImageView in it.
For those of you still having trouble with this, I actually had to redownload the SDK and import an additional framework ParseUI
Then import into bridger:
#import <ParseUI/ParseUI.h>
Time flies and if right now on the latest Parse version, if you are using cocoaPods, add pod 'Parse/UI' to your Podfile and update.
Then you can use PFImageView again.
Alternatively, just add this to your class:
import ParseUI
Related
I'm migrating from Obj-C to Swift and have just migrated from PSGameScene.h and PSGameScene.m to GameScene.swift.
When I build the app, I get an error stating that PSGameScene isn't a recognised symbol.
GameScene.swift is added to the "compile list", I've tried adding GameSCene-swift.h to the source, but it doesn't see it..
Where am I going wrong?
I can confirm that both the bridging header and the .swift file area added to the compile scheme.
In the .h and .m files, it does recognise the class, and when I imoprt trying to use (GameScene-swift.s it complains that the file isn't there...
I'm. little lost...
Any posters would be helpful...
Cheers,
A
Sounds like you want to use your new Swift class in Objective-C, check out this answer about how to mix and match the two in the same project.
The gist is: import the generated -Swift.h header in your .m file that you want to use the Swift class on (you can't import it in a .h, check the above answer for more):
// SomeImplementationFile.m
#import "ProjectName-Swift.h"
You can double check the name of your -Swift.h header in Build Settings / Objective-C Generated Interface Header Name.
The issue turned out to be related to the build settings. As defines module was set to NO, it didn't like the import. When the DEFINES_MODULE (defines module) setting was set to YES it all clicked into place.
This probably happened as it related to an old project which spans back to Xcode 4 days. It appears that the newer releases of Xcode don't take into account some settings.
Thanks for the answers..
I'm following an objC book and I need to use readline() to obtain a string.
However, before I can even get to that, I need to add the library that contains it. Therefore, I go into Build Phases -> Link Binary With Libraries -> Press the + ->Search and Add addlibreadline.dylib
After I do this, I have an icon under my top-level item that has the name of this library. BUT when I go into my code in main.m, NOTHING is imported. There is no #import
WHY? I have tried different things for hours and am frustrated!
Am I not understanding something about importing and libraries?
Btw: I am using Version 6.1.1 (6A2008a) and Yosemite 10.10.1 (14B25)
Thank you,
Since you've got the libraries linked, try adding this:
#import <readline/readline.h>
Then you should be able to use readline().
http://forums.bignerdranch.com/viewtopic.php?f=148&t=7617
I just updated my Parse frameworks, which now include Parse.framework, ParseUI.framework, ParseFacebookUtils.framework, and ParseCrashReporting.framework. After importing these frameworks into my swift project and importing the following statements into my bridging file:
#import <Parse/Parse.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <ParseCrashReporting/ParseCrashReporting.h>
#import <ParseUI/ParseUI.h>
I am getting errors that PFImageView does not have a member named loadInBackground(), although loadInBackground with a completion block works. Similarly, PFObject does not have a member named 'deleteInBackground()', althought .delete() works.
Is anyone else having a similar issue with the new Parse iOS SDK? Am I missing something here, or does this seem like a bug with Parse/Xcode? I've tried cleaning, building, and deleting the derived data for my project multiple times with no luck. Please let me know if there is not enough information provided. Thanks for the help.
Try deleteEventually() instead.
Since there is no easy way to add multi image selection in Appcelerator, I'd like to incorporate this project: WSAssetPickerController - https://github.com/w5mith/WSAssetPickerController into my Appcelerator project.
I'm able to create a simple custom module in XCode/ObjC, and call it from Appcelerator, but I'm not sure how to call code that has a UI such as WSAssetPickerController does. Any tips would be appreciated.
Here is some code I have working now. This is pretty much boiler plate Appcelerator Custom Module stuff contained in an ObjC implementation class:
https://gist.github.com/3976969
Then in my Appclerator project, I load this module like this:
// in app.js
var myModule = require('com.example.test');
Ti.API.info("--->module loaded is ---> "+myModule);
// in testing.js
function createFoo() {
myModule.sayHello();
}
So, with this in place I am able to create a custom module in ObjC, load it up into Appcelerator and call a method on it.
I now want to the open source module WSAssetPickerController - however, this is quite a bit more sophisticated than my sayHello() method, as it contain a user interface view that needs to be loaded and displayed from Appcelerator. The documentation says to include all the code from the "src" directory (which I have done) into my ObjC project, then use code like this to load it:
WSAssetPickerController *controller = [[WSAssetPickerController alloc] initWithDelegate:self];
[self presentViewController:controller animated:YES completion:NULL];
But, this not working for me. Within XCode, I get a compiler warning on the first line of:
"Sending 'ComExampleTestModule *' to parameter of incompatiple type 'id
UPDATE: after some changes here is what I have now:
I modified the #interface line in ComExampleTestModule.h to:
#interface ComExampleTestModule : TiModule <WSAssetPickerControllerDelegate>
and I added this import statement:
#import "WSAssetPicker/WSAssetPicker.h"
but I am still getting compiler warnings in my .m file like this: "Instance method '-dismissViewControllerAnimated:completion' not found (return type defaults to 'id'.......
Thanks for the help.
what have you got written so far? Can you post it somewhere??
also take a look at some code I have in my repo... it might get you started
http://blog.clearlyinnovative.com/post/27531529814/titanium-appcelerator-quickie-cardio-integration
Messing round a little in Xcode, and I was trying to get my app to look at the users music library with the use of MPMediaPickerController.
Following Apples documentation, I added the MediaPlayer.framework to the project, and in my header I've imported , giving me something like this:
#import <GameKit/GameKit.h>
#import <MediaPlayer/MediaPlayer.h>
#interface HelloMusic : UIViewController
{
}
So far so simple. Now, as far as I'm aware I should be able to do
MPMediaPickerController *mp = [[MPMediaPickerController alloc] init];
in my main file and set about launching my picker. Unfortunately XCode stubbronly refuses to admit that there is such a thing as an MPMediaPickerController - if I type MP and hit escape to get code complations I am without any of the MPMedia family. Annoyingly Xcode does recognise any MPMovie... class (from the same framework!). If I try and run the app it compiles fine so it must at least recognise the header from the framework, then chunters along until I get to the assignment of MPMediaPickerController, at which point I get an EXC_BAD_ACCESS, with a console output of
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
pthread_mutexattr_destroy$UNIX2003 called from function _ZN4llvm3sys5MutexC2Eb in image
libLLVMContainer.dylib.
I'm... certain I'm doing something beyond stupid, but I'm stuck nevertheless.
As the class reference states, it's declared in MPMediaPickerController.h. As such, simply adding...
#import <MediaPlayer/MPMediaPickerController.h>
...should solve your problems. :-)