how to expose hidden arrow objects from indicator in chart objects lists - algorithmic-trading

I have an indicator that draws arrows on the chart as seen in the image below:
I tried searching for the arrow objects in Object List but there were no objects there. I also checked Object List>List All menu. I guess the way that the indicator is written has hid them from the chart. How can I expose these objects from the indicator to the chart?
Here are some relevant bits of my indicator:
//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_plots 6
#property indicator_type1 DRAW_ARROW
#property indicator_width1 5
#property indicator_color1 0xFFAA00
#property indicator_label1 "Buy"
#property indicator_type2 DRAW_ARROW
#property indicator_width2 5
#property indicator_color2 0x0000FF
#property indicator_label2 "Sell"
#property indicator_type3 DRAW_ARROW
#property indicator_width3 5
#property indicator_color3 0xFFAA00
#property indicator_label3 "Buy"
#property indicator_type4 DRAW_ARROW
#property indicator_width4 5
#property indicator_color4 0x0000FF
#property indicator_label4 "Sell"
#property indicator_type5 DRAW_ARROW
#property indicator_width5 5
#property indicator_color5 0x00FFFB
#property indicator_label5 "CLOSE BUY"
#property indicator_type6 DRAW_ARROW
#property indicator_width6 5
#property indicator_color6 0x00FFFB
#property indicator_label6 "CLOSE SELL"
//--- indicator buffers
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double Buffer5[];
double Buffer6[];
datetime time_alert; //used when sending alert
input bool Audible_Alerts = true;
double myPoint; //initialized in OnInit
int MA_handle;
double MA[];
int MA_handle2;
double MA2[];
int MACD_handle;
double MACD_Signal[];
int MA_handle3;
double MA3[];
double Close[];
int MA_handle4;
double MA4[];
int MA_handle5;
double MA5[];
int MA_handle6;
double MA6[];
double Open[];
.
.
.
int OnInit()
{
SetIndexBuffer(0, Buffer1);
PlotIndexSetDouble(0, PLOT_EMPTY_VALUE, EMPTY_VALUE);
PlotIndexSetInteger(0, PLOT_ARROW, 241);
SetIndexBuffer(1, Buffer2);
PlotIndexSetDouble(1, PLOT_EMPTY_VALUE, EMPTY_VALUE);
PlotIndexSetInteger(1, PLOT_ARROW, 242);
SetIndexBuffer(2, Buffer3);
PlotIndexSetDouble(2, PLOT_EMPTY_VALUE, EMPTY_VALUE);
PlotIndexSetInteger(2, PLOT_ARROW, 241);
SetIndexBuffer(3, Buffer4);
PlotIndexSetDouble(3, PLOT_EMPTY_VALUE, EMPTY_VALUE);
PlotIndexSetInteger(3, PLOT_ARROW, 242);
SetIndexBuffer(4, Buffer5);
PlotIndexSetDouble(4, PLOT_EMPTY_VALUE, EMPTY_VALUE);
PlotIndexSetInteger(4, PLOT_ARROW, 251);
SetIndexBuffer(5, Buffer6);
PlotIndexSetDouble(5, PLOT_EMPTY_VALUE, EMPTY_VALUE);
PlotIndexSetInteger(5, PLOT_ARROW, 251);
//initialize myPoint
myPoint = Point();
if(Digits() == 5 || Digits() == 3)
{
myPoint *= 10;
}
MA_handle = iMA(NULL, PERIOD_CURRENT, 1, 0, MODE_SMA, PRICE_CLOSE);
if(MA_handle < 0)
{
Print("The creation of iMA has failed: MA_handle=", INVALID_HANDLE);
Print("Runtime error = ", GetLastError());
return(INIT_FAILED);
}
.
.
.

Arrows can be drawn as objects (in such a case you can find such objects when checking for the objects, select All because they can be hidden), or as indicator buffers. In your case, it looks like arrows are buffers because your indicator initializes buffers. In order to get data, you need to use iCustom function.

Related

JSONModel + copmlex object

I have some problem with this library and my objects,I have 3 kind of object:
page, widget, gallery
page:
int
string
dictionary of widget
widget:
int
string
dictionary gallery
gallery
int
string
array page
I create all protocol so I create something like:
page:
import widget
int
string
dict<Widget>
widget
import gallery
int
string
Gallery
dict<Gallery>
Gallery
import page
int
string
array<Page>
after I create delegate and all this I get "unknow type" error and cannot find protocol...where is the error?
You need to define protocol and import the header file
//Page.h
#protocol Page
#end
#class Widget;
#interface Page : JSONModel
#property (nonatomic, assign) NSInteger pageID;
#property (nonatomic, strong) NSString *name;
#property (nonatomic, strong) Widget *widget;
//Widget.h
#class Gallery;
#interface Widget : JSONModel
#property (nonatomic, assign) NSInteger widgetID;
#property (nonatomic, strong) NSString *name;
#property (nonatomic, strong) Gallery *gallery;
//Gallery.h
#import "Page.h"
#interface Gallery : JSONModel
#property (nonatomic, assign) NSInteger galleryID;
#property (nonatomic, strong) NSString *name;
#property (nonatomic, strong) NSArray<Page>* pages;

NSArray and tableview cocoa app

I have an NSArray with instances of an object with several attributes. I want to know how to display the NSString and int attributes of the instances in a tableview in a cocoa application. Sorry I am new to this.
card is designed to hold attributes of the individual cards.
deck is designed to hold an NSArray filled with cards and a name in order to be referenced by deckBuilder and deckConstruction.
deckBuilder is used to build instances of decks based on it's attribute, newDeck. (newDeck starts with all possible cards, and is copied with card entries removed to create new decks)
deckConstruction is the user interface, the .xib contains a table that is supposed to display the names of cards in the NSMutableArray, decks and the number values in the NSMutableArray, numberOf.
I cannot find a source on how to go about filling this table from the array though. (code supplied consists of 4 .h files for these objects)
//This is the Card object
// Card.h
// ProjectJJ
//
// Created by Guest User on 3/23/14.
//
//
#import <Foundation/Foundation.h>
#interface Card : NSObject
{
//defining what makes up a card
NSString *name;
NSString *attribute;
float level;
NSString *type;
NSString *info;
float attack;
float defence;
float cardNum;
}
#property (readwrite) NSString *name;
#property (readwrite) NSString *attribute;
#property (readwrite) float level;
#property (readwrite) NSString *type;
#property (readwrite) NSString *info;
#property (readwrite) float attack;
#property (readwrite) float defence;
#property (readwrite) float cardNum;
- (void)cards;
#end
// this is the deck object
// deck.h
// Cardsim
//
// Created by Guest User on 4/11/14.
//
//
#import <Foundation/Foundation.h>
#import "Card.h"
//the deck object for the users decks
#interface deck : NSObject
{
NSString *deckName; // the deck name
NSMutableArray *allCards;//will display in the interface all the cards in the database so the user can pick and choose from these
NSArray *numCardsInDeck;//will be next allCards indicating the number of each of the cards in the database that the user has put into their deck
NSMutableArray *cardsInDeck;//the acutal cards in thier deck
}
#property (readwrite) NSString *deckName;
#property (readwrite) NSArray *allCards;
#property (readwrite) Card *impendingFortress;
#property (readwrite) Card *fortressSoldier;
#property (readwrite) Card *fortressKnight;
#property (readwrite) Card *fortressArcher;
#property (readwrite) Card *fortressMage;
#property (readwrite) Card *appocalypticBeast;
- (void)setDeckCards:(NSArray *)c;
#end
// this is the NSWindowController
// deckConstruction.h
// Cardsim
//
// Created by Guest User on 4/2/14.
//
//
#import <Cocoa/Cocoa.h>
#import "deckBuilder.h"
#import "deck.h"
#interface deckConstruction : NSWindowController
{
NSMutableArray *decks;
NSMutableArray *numberOf;
deckBuilder *deckMaker;
}
#property (readwrite) NSString *deckName;
- (void)setDecks:(NSMutableArray *)a;
#end
//
// deckBuilder.h
// Cardsim
//
// Created by Guest User on 4/18/14.
//
//
#import <Foundation/Foundation.h>
#import "deck.h"
#import "card.h"
#interface deckBuilder : NSObject
{
deck *newDeck;
NSArray *numCard;
}
- (deck *)conDeck;
#end
I am also new and only use Objective-c right now.
The new TableView in Cocoa is table contain nsview in every single cell. To add value to each single cell. you will need to add the dependencry to the class where it manage the view.
AppDelegate:< NSTableViewDataSource, NSTabViewDelegate>
Remember to link the table to this class.
You need to let talbe know how many row it has
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView{
return <number of row in the data>;
}
In the implementation, you call
- (NSView *)tableView:(NSTableView *)tableView
viewForTableColumn:(NSTableColumn *)tableColumn
row:(NSInteger)row
{
NSTextField *result = [[NSTextField alloc] initWithFrame:[<your tableview> frame]];
// Add your custom for the cell in here.
return [result autorelease];
}
This will Function called and go throught every cell in your table.
Hope this help.

My app has a strange behavior under iOS 5

I am currently using the latest version of Xcode (Xcode 4.2 + iOS 5 SDK). My app is running on iOS 3.1.3 up to iOS 4.x with no problems for months. But not on iOS 5.
In the debugger I can see that my variables are not written correctly. In fact, other variables than the expected are changed instead.
I want to initialize a new view controller and then switch over. This is my code:
#interface ReviewDetailController : UIViewController <UIWebViewDelegate>
{
IBOutlet UIBarButtonItem *btnBack;
IBOutlet UIBarButtonItem *btnRestore;
IBOutlet UINavigationItem *navBar;
UIWebView *webView;
NSIndexPath *tabIndex;
NSString *htmlTemplate;
int entry;
id prevController;
}
#property (nonatomic, retain) IBOutlet UIWebView *webView;
#property (nonatomic, retain) IBOutlet UIBarButtonItem *btnBack;
#property (nonatomic, retain) IBOutlet UIBarButtonItem *btnRestore;
#property (nonatomic, assign) IBOutlet UINavigationItem *navBar;
#property (nonatomic, retain) NSString *htmlTemplate;
#property (nonatomic, retain) NSIndexPath *tabIndex;
#property (nonatomic, retain) id prevController;
#property (readwrite, assign) int entry;
- (DataModel *) dataModel;
- (IBAction) goBack: (id) sender;
- (IBAction) restore: (id) sender;
#end
The switch should take place when an item in a listView is tapped:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath {
ReviewDetailController *ctr = [[ReviewDetailController alloc] initWithNibName:#"ReviewDetailView" bundle:nil];
ctr.tabIndex = newIndexPath;
ctr.entry = [[[removedData objectAtIndex:newIndexPath.row] objectForKey:#"Entry"] intValue];
ctr.prevController = self.tabBarController.selectedViewController;
self.tabBarController.selectedViewController = ctr;
[ctr release];
}
After init (first line) ctr looks good:
ctr ReviewDetailController * 0x736f6c0
tabIndex NSIndexPath * 0x0
htmlTemplate NSString * 0x0
entry int 0
prevController id 0x0
A single step over the next line should set tabIndex, but htmlTemplate is changed!
ctr ReviewDetailController * 0x736f6c0
tabIndex NSIndexPath * 0x0
htmlTemplate NSIndexPath * 0x752b2f0
entry int 0
prevController id 0x0
The next line should set entry, but prevController get the value (int 2) for entry:
ctr ReviewDetailController * 0x736f6c0
tabIndex NSIndexPath * 0x0
htmlTemplate NSIndexPath * 0x752b2f0 Variable is not a CFString
entry int 0
prevController id 0x2
Also the next line does not set prevController as expected.
As mentioned before this code is still working on devices and simulators prior iOS 5.
I've tried to reorder the variables already, but without success. There must be something wrong, but I can't see what. So I hope, somebody more experienced will see and can tell me what to do.
The problem was in the line
self.tabBarController.selectedViewController = ctr;
In iOS5 it is no longer tolerated to change the view controller for a tab. I had to install a navigation controller on this tab and push and pop other views rather to change the tab's controller (as defined in IB).
I was running in that problem, because I got no CrashReport nor any console output when I was testing with iOS5. And with iOS4 the problem didn't happen.

Use Scripting Bridge to create an album in iPhoto and import a picture into this album

I have a document based drawing application that allows the user to save the final document as a JPEG file. Whenever the user saves a JPEG, I would like to import the picture to an iPhoto album "MyAppName album". I am using Using Scripting Bridge and i have added the iPhoto.h file to my application. I have also added the ScriptingBridge.framework
I am having some real trouble even creating the album "MyAppName album".
Can you please show me some code for the following pseudocode:
if (check whether "MyAppName album" exists) then
myalbum = "MyAppName album"
else
myalbum = create new album "MyAppName album"
end if
add picture "/Users/myusername/myfile.jpg" to myalbum
I have added the iPhoto.h below for your convenience:
/*
* iPhoto.h
*/
#import <AppKit/AppKit.h>
#import <ScriptingBridge/ScriptingBridge.h>
#class iPhotoItem, iPhotoApplication, iPhotoColor, iPhotoDocument, iPhotoWindow, iPhotoAttributeRun, iPhotoCharacter, iPhotoParagraph, iPhotoText, iPhotoAttachment, iPhotoWord, iPhotoAlbum, iPhotoKeyword, iPhotoPhoto, iPhotoPrintSettings;
enum iPhotoSavo {
iPhotoSavoAsk = 'ask ' /* Ask the user whether or not to save the file. */,
iPhotoSavoNo = 'no ' /* Do not save the file. */,
iPhotoSavoYes = 'yes ' /* Save the file. */
};
typedef enum iPhotoSavo iPhotoSavo;
enum iPhotoView {
iPhotoViewEdit = 'edit' /* edit */,
iPhotoViewEvents = 'evts' /* events */,
iPhotoViewOrganize = 'orga' /* organize */
};
typedef enum iPhotoView iPhotoView;
enum iPhotoAlTy {
iPhotoAlTyBookAlbum = 'book' /* book album */,
iPhotoAlTyEventsAlbum = 'eval' /* Album containing all the events in a library. */,
iPhotoAlTyFacesAlbum = 'faal' /* Album containing all the faces in a library. */,
iPhotoAlTyFlaggedAlbum = 'flal' /* Album containing all the flagged photos in a library. */,
iPhotoAlTyFolderAlbum = 'fldr' /* folder album */,
iPhotoAlTyLastImportAlbum = 'lstI' /* last import album */,
iPhotoAlTyLastMonthsAlbum = 'lstM' /* last months album */,
iPhotoAlTyLastRollsAlbum = 'lstR' /* last rolls album, but please use last import album now */,
iPhotoAlTyPhotoLibraryAlbum = 'aral' /* Album containing all the photos in a library. */,
iPhotoAlTyPlacesAlbum = 'plal' /* Album containing all the places in a library. */,
iPhotoAlTyPublishedAlbum = 'pubs' /* published album */,
iPhotoAlTyRegularAlbum = 'albm' /* regular album */,
iPhotoAlTySharedAlbum = 'papa' /* album of a shared library */,
iPhotoAlTySharedLibrary = 'papl' /* shared library; contains one or more children, which are shared albums */,
iPhotoAlTySlideshowAlbum = 'slds' /* slideshow album */,
iPhotoAlTySmartAlbum = 'smrt' /* smart album */,
iPhotoAlTySubscribedAlbum = 'subs' /* subscribed album */,
iPhotoAlTyTrashAlbum = 'tral' /* trash album */,
iPhotoAlTyUnknownAlbumType = 'aluk' /* unknown album type */
};
typedef enum iPhotoAlTy iPhotoAlTy;
enum iPhotoEnum {
iPhotoEnumStandard = 'lwst' /* Standard PostScript error handling */,
iPhotoEnumDetailed = 'lwdt' /* print a detailed report of PostScript errors */
};
typedef enum iPhotoEnum iPhotoEnum;
/*
* Standard Suite
*/
// A scriptable object.
#interface iPhotoItem : SBObject
#property (copy) NSDictionary *properties; // All of the object's properties.
- (void) closeSaving:(iPhotoSavo)saving savingIn:(NSURL *)savingIn; // Close an object.
- (void) delete; // Delete an object.
- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
- (BOOL) exists; // Verify if an object exists.
- (void) moveTo:(SBObject *)to; // Move object(s) to a new location.
- (void) saveAs:(NSString *)as in:(NSURL *)in_; // Save an object.
- (void) addTo:(id)to; // Add the given object to the container.
- (void) assignKeywordString:(NSString *)string; // Assign an existing keyword to the currently-selected photos.
- (void) autoImport; // Start importing photos from the auto-import folder.
- (void) duplicateTo:(id)to; // Create a duplicate of an object.
- (void) emptyTrash; // Empty the Trash album.
- (void) importFrom:(NSString *)from forceCopy:(NSInteger)forceCopy to:(iPhotoAlbum *)to; // Import the given path.
- (iPhotoAlbum *) newAlbumName:(NSString *)name; // Create a new album.
- (void) nextSlide; // Skip to previous slide in currently-playing slideshow.
- (void) pauseSlideshow; // Pause the currently-playing slideshow.
- (void) previousSlide; // Skip to next slide in currently-playing slideshow.
- (void) removeFrom:(id)from; // Remove the given object from its container.
- (void) resumeSlideshow; // Resume the currently-playing slideshow.
- (void) reverseGeocode; // Call after setting a photo's latitude and longitude. This command instructs iPhoto to use lat/lon to look up the country, city, point of interest, etc.
- (void) select; // Select one or more objects.
- (void) startSlideshowAsynchronous:(NSInteger)asynchronous displayIndex:(NSInteger)displayIndex iChat:(NSInteger)iChat usingAlbum:(NSString *)usingAlbum; // Display a slideshow with the currently-selected photos or album.
- (void) stopSlideshow; // End the currently-playing slideshow.
#end
// An application's top level scripting object.
#interface iPhotoApplication : SBApplication
- (SBElementArray *) documents;
- (SBElementArray *) windows;
#property (readonly) BOOL frontmost; // Is this the frontmost (active) application?
#property (copy, readonly) NSString *name; // The name of the application.
#property (copy, readonly) NSString *version; // The version of the application.
- (iPhotoDocument *) open:(NSURL *)x; // Open an object.
- (void) print:(NSURL *)x printDialog:(BOOL)printDialog withProperties:(iPhotoPrintSettings *)withProperties; // Print an object.
- (void) quitSaving:(iPhotoSavo)saving; // Quit an application.
#end
// A color.
#interface iPhotoColor : iPhotoItem
#end
// A document.
#interface iPhotoDocument : iPhotoItem
#property (readonly) BOOL modified; // Has the document been modified since the last save?
#property (copy) NSString *name; // The document's name.
#property (copy) NSString *path; // The document's path.
#end
// A window.
#interface iPhotoWindow : iPhotoItem
#property NSRect bounds; // The bounding rectangle of the window.
#property (readonly) BOOL closeable; // Whether the window has a close box.
#property (copy, readonly) iPhotoDocument *document; // The document whose contents are being displayed in the window.
#property (readonly) BOOL floating; // Whether the window floats.
- (NSInteger) id; // The unique identifier of the window.
#property NSInteger index; // The index of the window, ordered front to back.
#property (readonly) BOOL miniaturizable; // Whether the window can be miniaturized.
#property BOOL miniaturized; // Whether the window is currently miniaturized.
#property (readonly) BOOL modal; // Whether the window is the application's current modal window.
#property (copy) NSString *name; // The full title of the window.
#property (readonly) BOOL resizable; // Whether the window can be resized.
#property (readonly) BOOL titled; // Whether the window has a title bar.
#property BOOL visible; // Whether the window is currently visible.
#property (readonly) BOOL zoomable; // Whether the window can be zoomed.
#property BOOL zoomed; // Whether the window is currently zoomed.
#end
/*
* Text Suite
*/
// This subdivides the text into chunks that all have the same attributes.
#interface iPhotoAttributeRun : iPhotoItem
- (SBElementArray *) attachments;
- (SBElementArray *) attributeRuns;
- (SBElementArray *) characters;
- (SBElementArray *) paragraphs;
- (SBElementArray *) words;
#property (copy) NSColor *color; // The color of the first character.
#property (copy) NSString *font; // The name of the font of the first character.
#property NSInteger size; // The size in points of the first character.
#end
// This subdivides the text into characters.
#interface iPhotoCharacter : iPhotoItem
- (SBElementArray *) attachments;
- (SBElementArray *) attributeRuns;
- (SBElementArray *) characters;
- (SBElementArray *) paragraphs;
- (SBElementArray *) words;
#property (copy) NSColor *color; // The color of the first character.
#property (copy) NSString *font; // The name of the font of the first character.
#property NSInteger size; // The size in points of the first character.
#end
// This subdivides the text into paragraphs.
#interface iPhotoParagraph : iPhotoItem
- (SBElementArray *) attachments;
- (SBElementArray *) attributeRuns;
- (SBElementArray *) characters;
- (SBElementArray *) paragraphs;
- (SBElementArray *) words;
#property (copy) NSColor *color; // The color of the first character.
#property (copy) NSString *font; // The name of the font of the first character.
#property NSInteger size; // The size in points of the first character.
#end
// Rich (styled) text
#interface iPhotoText : iPhotoItem
- (SBElementArray *) attachments;
- (SBElementArray *) attributeRuns;
- (SBElementArray *) characters;
- (SBElementArray *) paragraphs;
- (SBElementArray *) words;
#property (copy) NSColor *color; // The color of the first character.
#property (copy) NSString *font; // The name of the font of the first character.
#property NSInteger size; // The size in points of the first character.
#end
// Represents an inline text attachment. This class is used mainly for make commands.
#interface iPhotoAttachment : iPhotoText
#property (copy) NSString *fileName; // The path to the file for the attachment
#end
// This subdivides the text into words.
#interface iPhotoWord : iPhotoItem
- (SBElementArray *) attachments;
- (SBElementArray *) attributeRuns;
- (SBElementArray *) characters;
- (SBElementArray *) paragraphs;
- (SBElementArray *) words;
#property (copy) NSColor *color; // The color of the first character.
#property (copy) NSString *font; // The name of the font of the first character.
#property NSInteger size; // The size in points of the first character.
#end
/*
* iPhoto suite
*/
// An album. This abstract class represents the albums within an iPhoto library.
#interface iPhotoAlbum : iPhotoItem
- (SBElementArray *) keywords;
- (SBElementArray *) photos;
#property (copy, readonly) NSArray *children; // Array of album's children albums in the library hierarchy.
- (NSInteger) id; // The unique ID of the album.
#property (copy) NSString *name; // The name of the album.
#property (copy, readonly) iPhotoAlbum *parent; // Album's parent in the library hierarchy.
#property (readonly) iPhotoAlTy type; // Type of album.
#property (copy, readonly) NSString *url; // URL of published/subscribed album.
#end
// iPhoto's top level scripting object.
#interface iPhotoApplication (IPhotoSuite)
- (SBElementArray *) albums;
- (SBElementArray *) keywords;
- (SBElementArray *) photos;
#property (copy) iPhotoAlbum *currentAlbum; // The selected album.
#property (copy, readonly) iPhotoAlbum *eventsAlbum; // Events album.
#property (copy, readonly) iPhotoAlbum *facesAlbum; // Faces album.
#property (copy, readonly) iPhotoAlbum *flaggedAlbum; // Flagged photos album.
#property (readonly) NSInteger importing; // Returns true if photo importing is in progress.
#property (copy, readonly) iPhotoAlbum *lastImportAlbum; // Last import album.
#property (copy, readonly) iPhotoAlbum *lastMonthsAlbum; // The set of N most recently imported month(s) of photos. N is based on the preference set in iPhoto.
#property (copy, readonly) iPhotoAlbum *lastRollsAlbum; // Now obsolete; please use last import album. Old: The set of N most recently imported roll(s) of photos. N is based on the preference set in iPhoto.
#property (copy, readonly) NSArray *localRootAlbums; // Returns local albums that are at the root level in the source view.
#property (copy) NSString *mailAddress; // The address for the e-mail.
#property (copy) NSString *mailRecipient; // The recipient for the e-mail.
#property (copy) NSString *mailSubject; // The subject for the e-mail.
#property (copy, readonly) iPhotoAlbum *photoLibraryAlbum; // The photo library.
#property (copy, readonly) iPhotoAlbum *placesAlbum; // Places album.
#property (copy) NSArray *selection; // The current selection.
#property (copy, readonly) NSArray *sharedLibraryAlbums; // Returns shared libraries from other computers on the network.
#property (readonly) NSInteger slideshowRunning; // Returns true if a slideshow is currently running.
#property (copy, readonly) iPhotoAlbum *trashAlbum; // The set of deleted photos.
#property iPhotoView view; // The current view in the application.
#end
// A keyword to associate with a photo.
#interface iPhotoKeyword : iPhotoItem
#property (copy) NSString *name; // The string value of the keyword.
#end
// A photo.
#interface iPhotoPhoto : iPhotoItem
- (SBElementArray *) keywords;
#property NSInteger altitude; // The GPS altitude in meters; MAXFLOAT means no altitude information.
#property (copy) NSString *comment; // A comment about the photo.
#property (copy) NSDate *date; // The date of the photo.
#property (copy, readonly) NSArray *dimensions; // The width and height of the photo in pixels.
#property (readonly) NSInteger height; // The height of the photo in pixels.
- (NSInteger) id; // The unique ID of the photo.
#property (copy, readonly) NSString *imageFilename; // The name of the image file.
#property (copy, readonly) NSString *imagePath; // The path to the image file.
#property NSInteger latitude; // The GPS latitude in range -90.0 to 90.0; MAXFLOAT means no GPS information. Use reverse geocode command after setting lat/lon.
#property NSInteger longitude; // The GPS longitude in range -180.0 to 180.0; MAXFLOAT means no GPS information. Measurement is taken from the prime meridian, so 'west' longitudes are negative numbers. Use reverse geocode command after setting lat/lon.
#property (copy) NSString *name; // The name (title) of the photo.
#property (copy, readonly) NSString *originalPath; // The path to the original image as it was imported to iPhoto.
#property NSInteger rating; // The start rating (0 through 5).
#property (copy, readonly) NSString *thumbnailFilename; // The name of the thumbnail file.
#property (copy, readonly) NSString *thumbnailPath; // The path to the thumbnail file.
#property (copy) NSString *title; // The title (name) of the photo.
#property (readonly) NSInteger width; // The width of the photo in pixels.
#end
/*
* Type Definitions
*/
#interface iPhotoPrintSettings : SBObject
#property NSInteger copies; // the number of copies of a document to be printed
#property BOOL collating; // Should printed copies be collated?
#property NSInteger startingPage; // the first page of the document to be printed
#property NSInteger endingPage; // the last page of the document to be printed
#property NSInteger pagesAcross; // number of logical pages laid across a physical page
#property NSInteger pagesDown; // number of logical pages laid out down a physical page
#property (copy) NSDate *requestedPrintTime; // the time at which the desktop printer should print the document
#property iPhotoEnum errorHandling; // how errors are handled
#property (copy) NSString *faxNumber; // for fax number
#property (copy) NSString *targetPrinter; // for target printer
- (void) closeSaving:(iPhotoSavo)saving savingIn:(NSURL *)savingIn; // Close an object.
- (void) delete; // Delete an object.
- (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
- (BOOL) exists; // Verify if an object exists.
- (void) moveTo:(SBObject *)to; // Move object(s) to a new location.
- (void) saveAs:(NSString *)as in:(NSURL *)in_; // Save an object.
- (void) addTo:(id)to; // Add the given object to the container.
- (void) assignKeywordString:(NSString *)string; // Assign an existing keyword to the currently-selected photos.
- (void) autoImport; // Start importing photos from the auto-import folder.
- (void) duplicateTo:(id)to; // Create a duplicate of an object.
- (void) emptyTrash; // Empty the Trash album.
- (void) importFrom:(NSString *)from forceCopy:(NSInteger)forceCopy to:(iPhotoAlbum *)to; // Import the given path.
- (iPhotoAlbum *) newAlbumName:(NSString *)name; // Create a new album.
- (void) nextSlide; // Skip to previous slide in currently-playing slideshow.
- (void) pauseSlideshow; // Pause the currently-playing slideshow.
- (void) previousSlide; // Skip to next slide in currently-playing slideshow.
- (void) removeFrom:(id)from; // Remove the given object from its container.
- (void) resumeSlideshow; // Resume the currently-playing slideshow.
- (void) reverseGeocode; // Call after setting a photo's latitude and longitude. This command instructs iPhoto to use lat/lon to look up the country, city, point of interest, etc.
- (void) select; // Select one or more objects.
- (void) startSlideshowAsynchronous:(NSInteger)asynchronous displayIndex:(NSInteger)displayIndex iChat:(NSInteger)iChat usingAlbum:(NSString *)usingAlbum; // Display a slideshow with the currently-selected photos or album.
- (void) stopSlideshow; // End the currently-playing slideshow.
#end
This should get you to the point of adding an event to events. Creating the album should just be an extra step which should be pretty straightforward once you get the below code working in your app.
//add photos
iPhotoApplication *photoApp = [SBApplication applicationWithBundleIdentifier:kIPhotoBundleIdentifier];
iPhotoAlbum *album = [photoApp eventsAlbum];
[album importFrom:#"/Users/myusername/myfile.jpg" forceCopy:NO to:album];
//Wait until photo importing is over.
while ( [photoApp importing] );

UISlider view problem

I am trying to make a UISlider/slider but I do not know why it is giving problems. Here is the snippet:
.h =
#interface sliderViewController : UIViewController {
IBOutlet UISlider *mySlider;
}
#property (nonatomic) float Value;
#property (nonatomic) float minimumValue;
#property (nonatomic) float maximumValue;
#property (nonatomic, getter=isContinuous) BOOL continuous;
#end
.m =
#implementation sliderViewController
#synthesize minimumValue;
#synthesize maximumValue;
#synthesize Value;
#synthesize continuous;
CGRect rect = CGRectMake(10, 60, 200, 30);
mySlider = [[UISlider alloc] initWithFrame:rect];
[mySlider addTarget:self
action:#selector(sliderValueChanges)
forControlEvents:UIControlEventValueChanged];
mySlider.backgroundColor = [UIColor clearColor];
mySlider.minimumValue = 0.0;
mySlider.maximumValue = 10.0;
mySlider.continuous = YES;
mySlider.value = 5.0;
[theView addSubview: mySlider];
}
- (void)sliderValueChanges:(id)sender{
UISlider *slider = sender;
if (mySlider==slider) {
printf("Value of slider is %f\n", [mySlider value]);
}
}
#end
Defining a UISlider object as an IBOutlet implies that you will connect that ivar to a UISlider in your interface via Interface Builder. Did you do that? If not, that would certainly explain why changing the slider value in the UI doesn't actually do anything.
Also, when you connect an IBOutlet ivar to a matching UI element in Interface Builder, there is no need then to create the object in your your code. It is already "created" by virtue of being defined in your NIB file.
The problem is with the way you are calling this method (sliderValueChanges). Rather than calling it like that please call it like (sliderValueChanges:).It works fine!

Resources