mogenerator doesn't generate the files - objective-c

I've just installed mogenerator using one of tutorials. I have added run script to my new target, and clicked Cmd+B. I should get some new files, but i didn't. In my .xcdatamodeld i have 2 entities (User and Repos). Below you can find my print screen of my project.
Where is the problem in my thinking? What should i do more? Please, help me, because i haven't found the solution on the web yet.

This all looks fine (judging by your screenshot).
One thing to check - which caused me the same issue - is that, when you've created your Entities in the xcdatamodelId file, make sure that you click on the Data Model Inspector icon, and that each entity has a Name value, and a matching "Class" value.
Miss out the Class name, and nothing will get generated.
Btw, when you click on Build, do you get a "Build succeeded" message ?
Here's the tutorial I followed to get mogenerator working:
RaptureInVenice
I should say, I've used mogenerator in a few projects, and this command line bit is always the piece that gives me trouble. Sometimes, I have to select my xcdatamodelId file, and create a new Version of it, before mogenerator will use it. But once it is working, it's a blessing.
Anything to avoid having to use the needlessly over-complicated CoreData stuff.
Someone should remind Apple that it's 2014...

Related

Xcode / AppleScript / Objective-C (AppDelegate.applescript)

I am having a lot of issues following this video tutorial. I'm getting hung up on the AppDelegate.applescript file. AppleScript Facelift
Here are the steps I'm taking:
1. Create a new project
2. Then I choose "App"
3.1 Options for interface
3.2 Options for Language
Save to file location - can't attach an image due to limit
5. "Template" files created
6. I can add frameworks and libraries (not sure if this is necessary? im doing things blindly...)
7. Then these are the AppDelegate files. (note- I can change the identity and type in the top right fields. if I select AppleScript Uncompiled Source, it does not change the extension)
I've tried creating a new "blank file" and saving it as AppDelegate.applescript, but I don't think this is working. Can someone point me in the right direction???
I've been working on an AppleScript project which works with my Apple Music. Someone mentioned I should look into Objective-C AppleScript, but this is making no sense. I think my end goal is having a window that allows more flexibility with input...
Thanks in advance!
The answer: I was taking a very dated approach to this and asking the wrong question.#has's suggestion to look at his project Swift-AppleScriptObjC is exactly what I needed.

Xcode cannot find ProductModuleName-Swift.h

I'm attempting to import my "-Swift.h" file into one of my Objective-C .h files but xcode keeps telling me that the file doesn't exist
#import "Aesculus-Swift.h"
If I command click on the file name it will take me to the generated header file so I know it exists. Why is xcode not able to find it?
This seems like just another issue with Xcode and it's complex tool chain of static analysers and compilers.
Openradar lists radar://21362856 - Swift to Objective-C bridging is unreliable. I am sure there are more but I stopped looking after finding one for this example.
The author imarcelv notes in the description:
I asked a Swift engineer at WWDC in a lab and even he didn't know how to fix this issue.
Steps to Reproduce:
Add a ramdom Swift class to an Objective-C project
Add the #import "ModuleName-Swift.h" file that Xcode generates automatically
Try to use it or just try to compile the project
From time to time it simply doesn't work
It's probably best to file a radar on this issue as it seems that others are already calling it out.
One other thing you could try...
Historically, it was possible for Xcode to completely lose it's syntax highlighting and you could always find out what files the static analyser was giving up on by increasing log level of clang.
I'm not sure if it's still relevant but if I was in your position I'd be trying this command:
defaults write com.apple.dt.Xcode IDEIndexingClangInvocationLogLevel 3
This generates logs you can search with using Console.app for just xcode to highlight the messages. You'll want to trash the derived data of your project to force it to re-compile things.
Although not the same issue as what you're seeing, I have had this post on the syntax highlighting issue bookmarked for years for the above defaults write command to try in times like these.
I solved this recently by adding the following entry to my .xcconfig (you could add it in Xcode's Build Settings > User Header Search Paths if you prefer).
USER_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/MyFramework.framework/Headers
This tells the compiler to search for headers in the build output directory, which is where Xcode puts the generated header (at least in the case of this framework).
In my case this is a directory like ~/Library/Developer/Xcode/DerivedData/MyProject-LongCode/Build/Products/Debug-iphonesimulator/MyFramework.framework/Headers/MyFramework. You might find your generated header in there too.
Xcode's header and dependency management is a hot mess, and it's not surprising that it doesn't work for you.
I had trouble with this stuff & found that your -Swift file is the Product name of your Target ( not just the name of your Target ) . I found the details here helpful: http://ericasadun.com/2014/08/21/swift-calling-swift-functions-from-objective-c/
When you encounter such situation, just find your kinda "ProductName-Swift.h" file by just cmnd+click on it (even if xcode shows warning about it is not found, the #import "Aesculus-Swift.h" string is still clickable) and then in opened code editor window choose context menu and "Show in Finder" item, then explicitly add it to your project.

get rid of “cannot find Symbol” error in intelliJ

Before everything was fine but since some time i get "cannot find Symbol” when i try to compile.
The errors are on my own classes.
If i jump to source and then click the error icon i get this:
But the constructor already exists.
I have no idea of how to get rid of it. I did a lot of searching but none of the solutions like clean worked.
My project is under VCS which i don't really understand (how to set up etc). So maybe it has to do something with that. I only don't know how to get rid of it. Can someone help?
edit:
Here is the zip of the project folder and one folder that includes a library that is used.
I try to compile with build artifacts.
https://dl.dropboxusercontent.com/u/17630770/temp/doekeLibsArchive.zip
I hope someone can give it a try. I would love to continue on this project.
The problem is coming from the fact you have two BezierVertex classes,
a public one nl.doekewartena.path.BezierVertex
and a nested one nl.doekewartena.path.BezierVertexPath.BezierVertex
when you are inside BezierVertexPath, intellij is right nl.doekewartena.path.BezierVertexPath.BezierVertex does not have the constructor shown on your screenshot, it is nl.doekewartena.path.BezierVertex which has it, so you should use the fully qualified name of that class.
Am I missing something ?

Can't find model for source store

I am new to objective C development. In inherited someone else's project.
I see that in his project, he has a folder called Model. In it are the files
Product.h
Product.m
Compatible.h
Compatible.m
Model.h
Model.m
MyProject.xcdatamodeld
A few days ago I created two new files called Warehouse.h and Warehouse.m, following the style of coding I saw in Product.h and Product.m. I also wrote some functions in Model.h and Model.m that helped me grab new Warehouses. I then created a new Entity in MyProject.xcdatamodeld by opening that file up in XCode, clicking Add Entity, renaming the entity and adding the necessary attributes.
I was able to use this new class/model in the rest of my project.
Today, i decided to add some new properties to my Warehouse.m. I then added new attributes to the MyProject.xcdatamodeld by clicking on the new attribute buttons.
Now my project crashes right when it starts up, giving me the error Can't find model for source store.
Am I doing something wrong? I vaguely remember someone telling me it's a headache of the model changes. Can someone recommend me reading on the subject matter? And how i can fix my situation?
I went to MyProject.xcdatamodeld. Then clicked on "Configuration" in the left navigation. Then I noticed a table showed up with the following contents:
Entity Abstract Class
Compatible un-checkbox Compatible
Product un-checkbox Product
Warehouse un-checkbox
I noticed that the Warehouse row didn't have a value for Class. So i typed in Warehouse in to it. Then everything worked.

Xcode error when ctrl-dragging image to new class

I already asked this in the Apple Dev Forum but received no replies, so I'll try here.
I'm unsure if this is a bug or whether I've missed something since I'm still very new to programming.
I have multiple view controllers and have made multiple classes. I have set the custom class "bit" of each view controller to the revelent class. When I ctrl-drag anything from the view to the relevent class header, I get the usual pop-up. I fill in the info, press connect, and BAM. It does the same kind of error whether I choose "Outlet" or "Action" It worked in the previous Xcode but I'm not sure if I've forgotten something.
The view controller and class that I added with Xcode 4 is still working beatifully.
I've tried adding the image manually but all that gave me was a SIGBART error just trying to get to the view. Again, I may have missed something, but I don't think there's much to miss is there?
Any help would be appreciated.
Just to eliminate a few things... I've deleted derived data, restarted Xcode and done a "clean". That's all I can remember that I've done.
Problem solved:
When selecting the implementation file. When I looked in the File Inspector, I found that under "Target Membership", the app name wasn't ticked. I ticked it and it now works well.
Since I didn't need to do that in Xcode 4, I suspect in Xcode 5, it doesn't do that automatically. Maybe that's a bug? I don't know if it was deliberate by Apple, but I think I'll file a bug report anyway since It's a bit of a nuisance.