| 
|  | 
| 
| hi all, 
 i m using NSPrintOperation using view.
 
 NSPrintOperation graphic context affect my print view design.
 
 when i print in landscape page my design also rotate.
 
 please help me how can i handle this.
 
 thanks in advance.
 
 |  |  |  | 
| 
|  | 
| 
| HI all 
 i am using NSPrintOperation with NSView for printing.
 
 portrait pages are print well,
 
 but Landscape printing not done properly please help me for this.
 
 
 
NSPrintOperation* printOperation = [NSPrintOperation printOperationWithView:my_print_view printInfo:printInfo];
        
        [[printOperation printInfo] setPaperSize:printInfo.paperSize];
        
        [[printOperation printInfo] setOrientation:NSPaperOrientationLandscape];
        
        
        [printOperation setCanSpawnSeparateThread:YES];
        [printOperation setShowsPrintPanel:NO];
               
        [printOperation runOperationModalForWindow:window delegate:window didRunSelector:nil contextInfo:nil]
 thanks in advance.
 
 |  |  |  | 
| 
|  | 
| 
| hi all 
 on printing action application get crashed with NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.' message.
 
 please help me for this.
 
 crash log is
 
 
 
Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  4
Application Specific Information:
abort() called
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x00007fff83ab3784 __exceptionPreprocess + 180
	1   libobjc.A.dylib                     0x00007fff89814f03 objc_exception_throw + 45
	2   CoreFoundation                      0x00007fff83ab35a7 +[NSException raise:format:arguments:] + 103
	3   CoreFoundation                      0x00007fff83ab3534 +[NSException raise:format:] + 148
	4   AppKit                              0x00007fff879c386e -[NSPrintSpoolingGraphicsContext dealloc] + 37
	5   CoreFoundation                      0x00007fff83a2ff93 __CFArrayReleaseValues + 435
	6   CoreFoundation                      0x00007fff83a0da73 _CFRelease + 179
	7   AppKit                              0x00007fff8746e53d __NSAppKitFinalizeThreadData + 260
	8   libSystem.B.dylib                   0x00007fff8098f751 _pthread_tsd_cleanup + 187
	9   libSystem.B.dylib                   0x00007fff8098f39c _pthread_exit + 147
	10  Foundation                          0x00007fff84f9718f __NSFinalizeThreadData + 0
	11  Foundation                          0x00007fff84f97127 __NSThread__main__ + 1448
	12  libSystem.B.dylib                   0x00007fff8098efd6 _pthread_start + 331
	13  libSystem.B.dylib                   0x00007fff8098ee89 thread_start + 13
)
Thread 4 Crashed:
0   libSystem.B.dylib             	0x00007fff809c89ce __semwait_signal_nocancel + 10
1   libSystem.B.dylib             	0x00007fff809c88d0 nanosleep$NOCANCEL + 129
2   libSystem.B.dylib             	0x00007fff80a253ce usleep$NOCANCEL + 57
3   libSystem.B.dylib             	0x00007fff80a44a00 abort + 93
4   libstdc++.6.dylib             	0x00007fff8a10e5d2 __tcf_0 + 0
5   libobjc.A.dylib               	0x00007fff89818b39 _objc_terminate + 100
6   libstdc++.6.dylib             	0x00007fff8a10cae1 __cxxabiv1::__terminate(void (*)()) + 11
7   libstdc++.6.dylib             	0x00007fff8a10cb16 __cxxabiv1::__unexpected(void (*)()) + 0
8   libstdc++.6.dylib             	0x00007fff8a10cbfc __gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
9   libobjc.A.dylib               	0x00007fff89814fa2 object_getIvar + 0
10  com.apple.CoreFoundation      	0x00007fff83ab35a7 +[NSException raise:format:arguments:] + 103
11  com.apple.CoreFoundation      	0x00007fff83ab3534 +[NSException raise:format:] + 148
12  com.apple.AppKit              	0x00007fff879c386e -[NSPrintSpoolingGraphicsContext dealloc] + 37
13  com.apple.CoreFoundation      	0x00007fff83a2ff93 __CFArrayReleaseValues + 435
14  com.apple.CoreFoundation      	0x00007fff83a0da73 _CFRelease + 179
15  com.apple.AppKit              	0x00007fff8746e53d __NSAppKitFinalizeThreadData + 260
16  libSystem.B.dylib             	0x00007fff8098f751 _pthread_tsd_cleanup + 187
17  libSystem.B.dylib             	0x00007fff8098f39c _pthread_exit + 147
18  com.apple.Foundation          	0x00007fff84f9718f __NSFinalizeThreadData + 0
19  com.apple.Foundation          	0x00007fff84f97127 __NSThread__main__ + 1448
20  libSystem.B.dylib             	0x00007fff8098efd6 _pthread_start + 331
21  libSystem.B.dylib             	0x00007fff8098ee89 thread_start + 13 
 |  |  |  | 
| 
|  | 
| 
| Lookup the error code: 
 kPMOutOfScope
 Your application called this function out of sequence with other printing functions.
 
 Declaration
 
 kPMOutOfScope = -30871
 
 From that I would guess that you have called
 PMSessionEndDocumentNoDialog()while printing is not - or not anymore - active.
 |  |  |  | 
| 
|  | 
| 
| i not called any of fiction related PMSessionEndDocumentNoDialog or kPMOutOfScope 
 i really don't know what happened even crash log not show any link to my application its shows all link to lib
 
 |  |  |  | 
| 
|  | 
| 
| kPMOutOfScopeis just the name of the error (a definition or anenum; should be declared in PMError.h).
 
 PMSessionEndDocumentNoDialogmight be called by other printing related functions or by a library (which seems happened in your case). So it may be a bug in that library or your code calls (printing) functions from that library without follwing the library reference documentation.
 There should be not so many code lines in your application that are printing related. I would start inspecting them for correct usage of functions by reading the documentation for the used functions. Add code to check function return values (if a start print / preparation function fails for example and you did not detect that but call other printing functions later, they will fail too which might include exceptions). If it is a third party library, contact the supplier or ask in a related forum.
 
 |  |  |  | 
|  | 
| 
|  | 
| 
| i rotate an image using this 
 
 
- (NSImage*)imageRotatedByDegrees_Angle:(CGFloat)degrees
{
    [[NSGraphicsContext
      currentContext] setImageInterpolation: NSImageInterpolationNone];
    
    
    
    NSRect imageBounds = {NSZeroPoint, [self size]};
    NSBezierPath* boundsPath = [NSBezierPath bezierPathWithRect:imageBounds];
    NSAffineTransform* transform = [NSAffineTransform transform];
    [transform rotateByDegrees:-1.0 * degrees];
    [boundsPath transformUsingAffineTransform:transform];
    NSRect rotatedBounds = {NSZeroPoint, [boundsPath bounds].size};
    
    
    imageBounds.origin.x = NSMidX(rotatedBounds) - (NSWidth(imageBounds) / 2);
    imageBounds.origin.y = NSMidY(rotatedBounds) - (NSHeight(imageBounds) / 2);
    
    NSImage* rotatedImage = [[NSImage alloc] initWithSize:rotatedBounds.size];
    
    
            NSAffineTransform* transform1 = [NSAffineTransform transform];
       
            [transform1 translateXBy:+(NSWidth(rotatedBounds) / 2)
                                yBy:+(NSHeight(rotatedBounds) / 2)];
            
            [transform1 rotateByDegrees:-1.0 * degrees];
            
            [transform1 translateXBy:-(NSWidth(rotatedBounds) / 2)
                                yBy:-(NSHeight(rotatedBounds) / 2)];
        
        
         [NSGraphicsContext saveGraphicsState];
     
        
        [[NSGraphicsContext currentContext]
         setImageInterpolation:NSImageInterpolationHigh];
        
        
        [rotatedImage lockFocus];
        
        
            [transform1 concat];
        
            [self drawInRect: imageBounds fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
        
        
         [rotatedImage unlockFocus];
        
        [NSGraphicsContext restoreGraphicsState];
        
            
    return rotatedImage;
    
}
 image is rotated but the rotated image is so blurry.
 
 Does anyone know how to solve it?
 
 please help me for this.
 
 |  |  |  | 
| 
|  | 
| 
| Hi all, 
 i have two different NSMutableArray one is source array and other is backup array,
 
 on some action copy the source array value to backup array.
 
 than continue the changes in source array objects.
 
 but here the backup array objects value automatically changed as i changed in source array.
 
 please help me i don't want to change backup array object even i change in source array object.
 
 thanks in advance.
 
 |  |  |  | 
| 
|  | 
| 
| I do not know Objective-C or Swift, but your description sounds like you have copied the object references instead of the actual content. 
 |  |  |  | 
| 
|  | 
| 
| help me how can i correct this... 
 |  |  |  | 
| 
|  | 
| 
| As I stated in my previous message, "I do not know Objective-C or Swift". So you need to look at what your code is actually doing and why it is not doing deep copy operations. Hint: you could always try the documentation for whichever language you are using. 
 |  |  |  | 
| 
|  | 
| 
| You need to clone the contents of the source array. [copy] method of NSMutableArray makes a reference copy with new array variable hence your content in backup array gets updated when you update source array. Use 
NSMutableArray initWithArrayto create a clone of source array but with new reference pointer to it. Hope it helps. 
 |  |  |  | 
| 
|  | 
| 
| I don't think this message was meant for me. 
 |  |  |  | 
| 
|  | 
| 
| hi all, 
 please guide me to how to access connected webcam in my machine and capture the image from camera.
 
 thanks in advance.
 
 |  |  |  | 
| 
|  | 
| 
| What machine are you trying to access the web camera from? What language are you using? 
 This space for rent 
 |  |  |  | 
| 
|  | 
| 
| i have mac mini and use objective c for this. 
 |  |  |  | 
| 
|  | 
| 
| Check the documentation of your camera. The manufacturer might also provide an SDK with example code. 
 If that does not help search the web using the keywords Mac and/or Objective-C and your camera model.
 
 |  |  |  | 
| 
|  | 
| 
| thank u 
 i found a sample
 
 [^]
 
 but here not explain how to i use it in my nswindowcontroller class.
 
 
 please help
 
 |  |  |  | 
| 
|  | 
| 
| I'm sorry but I have not programmed for the Mac so far. How about using the comment section at your link?
 
 |  |  |  | 
| 
|  | 
| 
| Hi all, 
 i want to add textfield and checkbox in a box.
 
 i use size to fit option for fox after adding control, its resize the box but change the location of box upward .
 
 i don't want to change the location of box,
 
 i want when i add control box increase height at downward.
 
 please help me for this.
 
 |  |  |  | 
|  | 
| 
|  | 
| 
| You certainly do.Member 13195612 wrote:Need help
 
 |  |  |  | 
| 
|  | 
| 
| hi all, 
 when i trying to print or preview multiple pages from my application
 
 i got this
 
 exception
 
 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.'
 
 i really don't understand
 
 what can i do here.
 
 in printing i pass an image creating from rendering of my customise view.
 
 please help me for this.
 
 if there is a one page its working fine
 
 but when i create different image at time of printing its crash
 
 
 
crash log:
Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  7
Application Specific Information:
abort() called
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.'
Thread 7 Crashed:
0   libSystem.B.dylib             	0x00007fff837d59ce __semwait_signal_nocancel + 10
1   libSystem.B.dylib             	0x00007fff837d58d0 nanosleep$NOCANCEL + 129
2   libSystem.B.dylib             	0x00007fff838323ce usleep$NOCANCEL + 57
3   libSystem.B.dylib             	0x00007fff83851a00 abort + 93
4   libstdc++.6.dylib             	0x00007fff8791f5d2 __tcf_0 + 0
5   libobjc.A.dylib               	0x00007fff8116cb39 _objc_terminate + 100
6   libstdc++.6.dylib             	0x00007fff8791dae1 __cxxabiv1::__terminate(void (*)()) + 11
7   libstdc++.6.dylib             	0x00007fff8791db16 __cxxabiv1::__unexpected(void (*)()) + 0
8   libstdc++.6.dylib             	0x00007fff8791dbfc __gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
9   libobjc.A.dylib               	0x00007fff81168fa2 object_getIvar + 0
10  com.apple.CoreFoundation      	0x00007fff800b45d7 +[NSException raise:format:arguments:] + 103
11  com.apple.CoreFoundation      	0x00007fff800b4564 +[NSException raise:format:] + 148
12  com.apple.AppKit              	0x00007fff8556086e -[NSPrintSpoolingGraphicsContext dealloc] + 37
13  com.apple.CoreFoundation      	0x00007fff80030fc3 __CFArrayReleaseValues + 435
14  com.apple.CoreFoundation      	0x00007fff8000eaa3 _CFRelease + 179
15  com.apple.AppKit              	0x00007fff8500b53d __NSAppKitFinalizeThreadData + 260
16  libSystem.B.dylib             	0x00007fff8379c751 _pthread_tsd_cleanup + 187
17  libSystem.B.dylib             	0x00007fff8379c39c _pthread_exit + 147
18  com.apple.Foundation          	0x00007fff83bd227f __NSFinalizeThreadData + 0
19  com.apple.Foundation          	0x00007fff83bd2217 __NSThread__main__ + 1448
20  libSystem.B.dylib             	0x00007fff8379bfd6 _pthread_start + 331
21  libSystem.B.dylib             	0x00007fff8379be89 thread_start + 13 ..
 
 please help
 
 
 modified  5-Apr-17 8:11am. 
 |  |  |  | 
| 
|  | 
| 
| Before the task finish r u sending another image to print. The error seems to be like this. In case of multiple images all images should be in a queue , First come first serve. Till one job is not done . another image should wait. 
 |  |  |  |